Re: How to filter on timestamps? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: How to filter on timestamps?
Date
Msg-id 20040708191855.GE10089@dcc.uchile.cl
Whole thread Raw
In response to How to filter on timestamps?  ("B.W.H. van Beest" <bwvb@xs4all.nl>)
List pgsql-general
On Tue, Jul 06, 2004 at 01:27:29AM +0200, B.W.H. van Beest wrote:

> I have a table where one of the columns is of type 'TIMESTAMP'
>
> How can I do a query to filter on the TIMESTAMP value, e.g. to obtain
> all rows earlier than a certain time stamp?

SELECT ... WHERE timestamp_field < 'certain timestamp';

You may need an explicit cast to timestamp in the constant, like
cast('certain timestamp' as timestamp)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"El día que dejes de cambiar dejarás de vivir"

pgsql-general by date:

Previous
From: Jim Rosenberg
Date:
Subject: Subtransaction syntax in 7.5??
Next
From: Bruce Momjian
Date:
Subject: Re: Subtransaction syntax in 7.5??