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

Re: PostGreSQL Date Query?

From: Dave Cramer <pg(at)fastcrypt(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:43:44
Message-ID: 4230B180.7060104@fastcrypt.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
That's very strange. have you tried the query in psql. Also you can use 
the between clause.

I'd also recommend using prepared statements and setDate, just to make 
sure the date is formatted correctly.

Dave

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.
>
> Anyone can help me.
>
>
>
> Using Java 2 SE 1.4.2, PostGreSQL 8.0
>
>
> Kind Regards,
>
>
>
> Lennie De Villiers
>
>

-- 
Dave Cramer
http://www.postgresintl.com
519 939 0336
ICQ#14675561


In response to

pgsql-jdbc by date

Next:From: Diego GilDate: 2005-03-10 20:44:54
Subject: Re: PostGreSQL Date Query?
Previous:From: Oliver JowettDate: 2005-03-10 20:39:01
Subject: Re: timestamp issues

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