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

Comparing Dates

From: Nick Peters <nick(dot)peters(at)candoltd(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Comparing Dates
Date: 2004-11-18 21:01:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql

I am trying to compare dates in a sql statement. this is what i have tried:

SELECT * FROM transactions WHERE shippingdate>2004-06-08 AND 

but it returns all rows. When i switch the > with a < it returns 
nothing. I have even tried with todays date and have got the same 
results. So i guess my question is how do i compare two dates? BTW the 
column by the name of shippingdate is a date data type with the same 
format as the dates show above.

Thanks in advance.



pgsql-sql by date

Next:From: Ian BarwickDate: 2004-11-18 21:10:23
Subject: Re: Comparing Dates
Previous:From: Justine.ClearyDate: 2004-11-18 19:28:03
Subject: missing... at end of sql expression

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