How to filter on timestamps?

Started by B.W.H. van Beestalmost 22 years ago2 messagesgeneral
Jump to latest
#1B.W.H. van Beest
bwvb@xs4all.nl

Gentle people, I don't get it.

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?

Regards,

#2Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: B.W.H. van Beest (#1)
Re: How to filter on timestamps?

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"