X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 44D765659A for ; Thu, 10 Mar 2005 21:00:22 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 57660-09 for ; Thu, 10 Mar 2005 21:00:12 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 2BB32565CA for ; Thu, 10 Mar 2005 21:00:11 +0000 (GMT) Received: (qmail 18006 invoked from network); 10 Mar 2005 20:59:13 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 10 Mar 2005 20:59:13 -0000 Message-ID: <4230B551.4070900@fastcrypt.com> Date: Thu, 10 Mar 2005 16:00:01 -0500 From: Dave Cramer Reply-To: pg@fastcrypt.com Organization: Postgres International User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Scott Marlowe Cc: Lennie De Villiers , pgsql-jdbc@postgresql.org Subject: Re: PostGreSQL Date Query? References: <1110487133.28555.7.camel@state.g2switchworks.com> <4230B1E2.10001@fastcrypt.com> <1110487845.28555.12.camel@state.g2switchworks.com> In-Reply-To: <1110487845.28555.12.camel@state.g2switchworks.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.04 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/109 X-Sequence-Number: 12501 This is why I almost never, no make that never try to set a timestamp or a date parameter in a java query without using prepared statements let the driver work out the details... Dave Scott Marlowe wrote: >You'd think that as the guy who'd pissed and moaned until the old >behaviour was changed I would have thought of that. but no... > >Too much going on today. I bet it's a text field. > >On Thu, 2005-03-10 at 14:45, Dave Cramer wrote: > > >>That's what I thought too, but pg should give him an error if he is >>asking for the 28th month. >> >>Dave >> >>Scott Marlowe wrote: >> >> >> >>>On Tue, 2005-03-08 at 15:51, Lennie De Villiers wrote: >>> >>> >>> >>> >>>>Hi, >>>> >>>> >>>>I'm using Java together with PostGreSQL database. >>>> >>>> >>>> >>>>I'm having a problem with a date query, when I write: >>>> >>>> >>>> >>>>select sRescheduleDate, * from tbl_leads >>>> >>>>where sRescheduleDate >= '01/01/2005' AND sRescheduleDate <= >>>>'28/01/2005' >>>> >>>>and bRescheduleCall = true >>>> >>>> >>>> >>>>the query also return the values for "01/04/2005" where it should only >>>>return those between that date range. >>>> >>>> >>>> >>>> >>>Sounds like your month and day are not where you think they are. >>> >>>http://www.postgresql.org/docs/7.4/static/datatype-datetime.html#DATATYPE-DATETIME-INPUT >>> >>>---------------------------(end of broadcast)--------------------------- >>>TIP 8: explain analyze is your friend >>> >>> >>> >>> >>> >>> > > > > -- Dave Cramer http://www.postgresintl.com 519 939 0336 ICQ#14675561