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

From Michael Burke
Subject Re: Querying date_time for date only ?
Date
Msg-id 200512200919.49986.michael@engtech.ca
Whole thread Raw
In response to Querying date_time for date only ?  (Aarni Ruuhimäki <aarni@kymi.com>)
Responses Re: Querying date_time for date only ?  (Aarni Ruuhimäki <aarni@kymi.com>)
Re: Querying date_time for date only ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
On December 20, 2005 08:59 am, Aarni Ruuhimäki wrote:
> Hello List,
>
> 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.
>
> (Pg)SQL way to do this ?

You can try,

SELECT field::date FROM mytable;

to select only the date part.  Likewise, you can use field::time if you want
to disregard the date.

> TIA,
>
> Aarni

HTH.
Mike.

--
Michael Burke
michael@engtech.ca


pgsql-sql by date:

Previous
From: Aarni Ruuhimäki
Date:
Subject: Querying date_time for date only ?
Next
From: Aarni Ruuhimäki
Date:
Subject: Re: Querying date_time for date only ?