Received: from hub.org.org (localhost [127.0.0.1]) by hub.org (8.10.1/8.11.0) with SMTP id e9P4Hjl02636 for ; Wed, 25 Oct 2000 00:17:45 -0400 (EDT) (envelope-from pgsql-interfaces-owner@hub.org) Received: from sushi.toad.net (IDENT:root@sushi-old.toad.net [209.150.117.251]) by hub.org (8.10.1/8.11.0) with ESMTP id e9ON9LN32178 for ; Tue, 24 Oct 2000 19:09:21 -0400 (EDT) (envelope-from khkachn@toad.net) Received: from toad.net (core19d175.dynamic-dialup.toad.net [162.33.189.175]) by sushi.toad.net (8.9.3/8.9.3) with ESMTP id TAA10040; Tue, 24 Oct 2000 19:09:10 -0400 Message-ID: <39F616B9.B228F44C@toad.net> Date: Tue, 24 Oct 2000 19:09:45 -0400 From: Ken Kachnowich Reply-To: khkachn@NOSPAMtoad.net X-Mailer: Mozilla 4.61 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: Cedar Cox , Postgres interfaces Subject: Re: RE: datetime fix References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200010/201 X-Sequence-Number: 1558 I do a PreparedStatement and setTimestamp() to do the select. The Timestamp value is converted into a String in the JDBC code. This may not be a JDBC problem. I can not select by a datetime field in psql all the time. It seems if the milliseconds are below some value it works and if above not. .62 worked for me but .71 did not. I did a copy and paste of the datetime value to get it right: select * from table_a; | fld1 --------------------------- |2000-10-24 10:15:01.71-04| select * from table_a where fld1 = '2000-10-24 10:15:01.71'; 0 records found I had to make a change to the JDBC code to even get the .62 select to work. The Timestamp toString() method gives a 3 digit millisecond value and Postgres seems to not want the leading zero (ie: .62 viz .062). I will try these with query=1 in pg_options to get the query. Ken Cedar Cox wrote: > > > - select the datetime field from table A into a Timestamp variable > > - Use this Timestamp variable to select the record from table B > > > > I get no records found when I do this. > > Interesting thought: Is a timestamp numeric or string data? How do you > specify it in a query? Do you quote it? > > -Cedar