Re: PostGreSQL Date Query?

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
Cc: Lennie De Villiers <lenniedg(at)lando(dot)co(dot)za>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: PostGreSQL Date Query?
Date: 2005-03-10 21:00:01
Message-ID: 4230B551.4070900@fastcrypt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Herman Visser 2005-03-10 21:36:53 class not found
Previous Message Scott Marlowe 2005-03-10 20:50:45 Re: PostGreSQL Date Query?