Re: PostGreSQL Date Query?

From: "Prasanth" <dbadmin(at)nqadmin(dot)com>
To: "Scott Marlowe" <smarlowe(at)g2switchworks(dot)com>, "Lennie De Villiers" <lenniedg(at)lando(dot)co(dot)za>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: PostGreSQL Date Query?
Date: 2005-03-10 20:48:49
Message-ID: LGEKIACNKCMPMALCJMLOMENNEBAA.dbadmin@nqadmin.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

>Sounds like your month and day are not where you think they are.

In which case you will get an error message saying that "date/time field
value out of range."

-Prasanth.

-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org]On Behalf Of Scott Marlowe
Sent: Thursday, March 10, 2005 2:39 PM
To: Lennie De Villiers
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] PostGreSQL Date Query?

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-DA
TETIME-INPUT

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Scott Marlowe 2005-03-10 20:50:45 Re: PostGreSQL Date Query?
Previous Message Dave Cramer 2005-03-10 20:45:22 Re: PostGreSQL Date Query?