Hi all,

I've got a database with a column I CAST as a TIMESTAMP. The data in the database is GMT.

I want to say in my WHERE clause to offset the value I am giving by X number of hours and to display the column I've cast as a timestamp offset by the same X hours.

  I am sure this is possible, and probably fairly simple. :)

Here a simplified query I am using that currently has no TZ data:

'bar' is a timestamp from the system, 'baz' is a string from an external source CAST as a timestamp.

SELECT
  foo,
  bar,
  CAST (baz AS TIMESTAMP) AS last_state_change
FROM
  history.table
WHERE
  bar >= '2008-12-15 14:01:09' AND foo=153;

Thanks!

Madi

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to