Campbell, Lance wrote:
Michael,
So based on your feedback would it be better to do option A or B below?

1) I have a timestamp field, "some_timestamp", in table "some_table".
2) I want to compare field "some_timestamp" to the current date - 1 day.
I need to ignore hours, minutes and seconds.
You might want to use date_trunc then:

select * from sometable where date_trunc('day',tiemstampfield) > date_trunc('day',now() - interval '1 day');

or something like that.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq

Reply via email to