Re: Querying date_time for date only ?

From: Michael Burke <michael(at)engtech(dot)ca>
To: pgsql-sql(at)postgresql(dot)org, aarni(at)kymi(dot)com
Subject: Re: Querying date_time for date only ?
Date: 2005-12-20 13:19:49
Message-ID: 200512200919.49986.michael@engtech.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)engtech(dot)ca

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Aarni Ruuhimäki 2005-12-20 13:33:42 Re: Querying date_time for date only ?
Previous Message Aarni Ruuhimäki 2005-12-20 12:59:07 Querying date_time for date only ?