[SQL] what's wrong with my date comparison?

2007-10-16 Thread Tena Sakai
Hi Everybody, I have a table with a column of timestamp type. It is known to postgres like this: name| character varying | not null value | character varying | not null datecreated | timestamp without time zone | not null when I do query

Re: [SQL] what's wrong with my date comparison?

2007-10-16 Thread Tena Sakai
] what's wrong with my date comparison? Hi Everybody, I have a table with a column of timestamp type. It is known to postgres like this: name| character varying | not null value | character varying | not null datecreated | timestamp without time

Re: [SQL] what's wrong with my date comparison?

2007-10-16 Thread Michael Glaesemann
On Oct 16, 2007, at 12:57 , Tena Sakai wrote: select name, value, datecreated from mytable where datecreated 2007-10-02; where datecreated '2007-10-02' 2007-10-02 = 1995. # select current_date 2007-10-31 as arithmetic_comparison, current_date '2007-10-31' as date_comparison;

Re: [SQL] what's wrong with my date comparison?

2007-10-16 Thread Tom Lane
Tena Sakai [EMAIL PROTECTED] writes: I was missing quotes. It must have evaluated 2007-10-02 and used it as a numerical constant 1995. Actually, what you got was a *textual* comparison between '1995' and the timestamp converted to text, which makes even less sense. FWIW, as of PG 8.3 you'll