Skip site navigation (1) Skip section navigation (2)

Re: PostGreSQL Date Query?

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: 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:38:53
Message-ID: 1110487133.28555.7.camel@state.g2switchworks.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
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

In response to

Responses

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2005-03-10 20:39:01
Subject: Re: timestamp issues
Previous:From: Charl GerberDate: 2005-03-10 14:03:45
Subject: timestamp issues

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group