Selecting rows where timestamp between two timestamps

From: Jeff Lanzarotta <delux256-postgresql(at)yahoo(dot)com>
To: PostgreSQL GENERAL List <pgsql-general(at)postgresql(dot)org>
Subject: Selecting rows where timestamp between two timestamps
Date: 2007-08-13 14:16:30
Message-ID: 814099.51287.qm@web36814.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I am trying to get this query to work with no luck...

select * from foobar where ts between now() and now() - interval '5 days'

btw, the column ts is defined as:

ts timestamp with time zone NOT NULL DEFAULT now()

No rows are returned, but I know there are at least 100 rows that should be returned...

Any ideas?

Thanks.

-Jeff

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Terri Reid 2007-08-13 14:23:00 non superuser creating flat files
Previous Message Michael Glaesemann 2007-08-13 14:13:51 Re: TimestampTZ