From: | "Belinda M(dot) Giardine" <giardine(at)bio(dot)cse(dot)psu(dot)edu> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | date comparisons |
Date: | 2006-12-12 16:32:47 |
Message-ID: | Pine.GSO.4.53.0612121125220.28737@galapagos.bx.psu.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-patches |
This should be simple but I am missing something. I am trying to extract
all records entered after a given date. The table has a field
date_entered which is a timestamp. In this particular case I am not
worried about time.
I have tried:
select id from main_table where
date_entered > to_timestamp('January 2006', 'Month YYYY');
select id from main_table where
(to_timestamp('January 2006', 'Month YYYY'), now()) overlaps (date_entered, date_entered);
Both of these return all the rows in the table. Half of the rows are
dated 2000-06-22 12:00:00.
PostgreSQL version 8.1.4
What am I missing?
Belinda
From | Date | Subject | |
---|---|---|---|
Next Message | Erik Jones | 2006-12-12 16:32:58 | Re: Why DISTINCT ... DESC is slow? |
Previous Message | Richard Huxton | 2006-12-12 16:27:02 | Re: search_path when restoring to new db |
From | Date | Subject | |
---|---|---|---|
Next Message | Erik Jones | 2006-12-12 16:46:16 | Re: date comparisons |
Previous Message | Kevin Grittner | 2006-12-12 15:03:23 | Re: Load distributed checkpoint |