Re: subtract a day from the NOW function

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: subtract a day from the NOW function
Дата
Msg-id 46684A70.4080903@g2switchworks.com
обсуждение исходный текст
Ответ на Re: subtract a day from the NOW function  ("Campbell, Lance" <lance@uiuc.edu>)
Ответы Re: subtract a day from the NOW function  (Steve Crawford <scrawford@pinpointresearch.com>)
Список pgsql-sql
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.


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Campbell, Lance"
Дата:
Сообщение: Re: subtract a day from the NOW function
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: subtract a day from the NOW function