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

what's wrong with my date comparison?

From: "Tena Sakai" <tsakai(at)gallo(dot)ucsf(dot)edu>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: what's wrong with my date comparison?
Date: 2007-10-16 17:57:03
Message-ID: FE44E0D7EAD2ED4BB2165071DB8E328C03062CEA@egcrc-ex01.egcrc.org (view raw or flat)
Thread:
Lists: pgsql-sql
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

 select name, value, datecreated
   from mytable
  where datecreated > 2007-10-02;

it reports:

   name   |        value         |       datecreated       
----------+----------------------+-------------------------
 al_qual  | 0                    | 2007-08-09 00:06:06.742
 srehquan | 3                    | 2007-08-09 00:06:06.742
 complete | 1                    | 2007-08-09 00:06:06.743
 al_quan  | 0.315924933          | 2007-08-09 00:06:06.742
 bsa_qual | 0                    | 2007-08-09 00:06:06.743
 bsl_qual | 2                    | 2007-08-09 00:06:06.743
 sh_qual  | 0                    | 2007-08-09 00:06:06.742
    .             .                    .           .
    .             .                    .           .

I don't understand why it thinks August is greater than
October.  Can someone please elucidate what is going on?

Regards,

Tena Sakai
tsakai(at)gallo(dot)ucsf(dot)edu

Responses

pgsql-sql by date

Next:From: Tena SakaiDate: 2007-10-16 18:00:08
Subject: Re: what's wrong with my date comparison?
Previous:From: Michael GlaesemannDate: 2007-10-16 17:34:13
Subject: Re: Having difficulty writing a "best-fit" query..

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