Re: comparing dates with timestamps ?

Поиск
Список
Период
Сортировка
От Robby Russell
Тема Re: comparing dates with timestamps ?
Дата
Msg-id 1108319931.5245.92.camel@linus
обсуждение исходный текст
Ответ на comparing dates with timestamps ?  (raptor <raptor@tvskat.net>)
Список pgsql-general
On Sun, 2005-02-13 at 18:57 +0200, raptor wrote:
> how to compare dates with timestamp..if i dont care about
> the hour:minute part of the timestamp... i.e. i want
> to be able to do exact match :
>
> timestamp in (select date from table where .....)

Try something like this: (created is a timestamp data type)

 SELECT created::date FROM orders.payment WHERE id = 100;
  created
------------
 2004-11-28

or

SELECT id, email FROM orders.payment WHERE created::date = now()::date;

-Robby

--
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | robby@planetargon.com
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
****************************************/


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [pgsql-www] Website Documentation
Следующее
От: bradsnobar@netscape.net (Bradley D. Snobar)
Дата:
Сообщение: unsubscribe