Re: Querying date_time for date only ? - Mailing list pgsql-sql

From Tom Lane
Subject Re: Querying date_time for date only ?
Date
Msg-id 29114.1135091137@sss.pgh.pa.us
Whole thread Raw
In response to Re: Querying date_time for date only ?  (Michael Burke <michael@engtech.ca>)
List pgsql-sql
Michael Burke <michael@engtech.ca> writes:
> On December 20, 2005 08:59 am, Aarni Ruuhim�ki wrote:
>> I have a time stamp without time zone field, YYYY-MM-DD hh:mm:ss, in my
>> table. I want to also find something just for a particular day regardless
>> of the time.

> You can try,
> SELECT field::date FROM mytable;

The date_trunc() function can also be useful for this sort of thing,
particularly if you need to round off to something finer or coarser
than days.
http://www.postgresql.org/docs/8.1/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC
        regards, tom lane


pgsql-sql by date:

Previous
From: Michael Burke
Date:
Subject: Re: Sub-query as function argument
Next
From: Tom Lane
Date:
Subject: Re: Sub-query as function argument