Re: what's wrong with my date comparison?

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: what's wrong with my date comparison?
Date: 2007-10-16 18:04:55
Message-ID: 20071016180455.GQ3255@crankycanuck.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Oct 16, 2007 at 10:57:03AM -0700, Tena Sakai wrote:
> select name, value, datecreated
> from mytable
> where datecreated > 2007-10-02;
^^^^^^^^^^

2007-10-02 is an arithmetic expression equivalent to 1995.

I think what you want is

WHERE datecreated > '2007-10-02';

Note the quotes.

A

--
Andrew Sullivan | ajs(at)crankycanuck(dot)ca
In the future this spectacle of the middle classes shocking the avant-
garde will probably become the textbook definition of Postmodernism.
--Brad Holland

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Glaesemann 2007-10-16 18:09:03 Re: what's wrong with my date comparison?
Previous Message Tena Sakai 2007-10-16 18:00:08 Re: what's wrong with my date comparison?