Re: How to convert postgres timestamp to date: yyyy-mm-dd

From: "Adam Rich" <adam(dot)r(at)sbcglobal(dot)net>
To: "'CaseT'" <ctorres(at)quantumcomposers(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to convert postgres timestamp to date: yyyy-mm-dd
Date: 2008-03-11 18:22:03
Message-ID: 018b01c883a4$ce984520$6bc8cf60$@r@sbcglobal.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I need to convert postgres timestamp to date format yyyy-mm-dd in a
> sql statement.
> pt.created_date below is timestamp format
>
> i.e ... WHERE pt.created_date >= '2008-01-21'
>
> Any help would be greatly appreciated.

Try this:

WHERE pt.created_date >= '2008-01-21'::date

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2008-03-11 18:26:06 Re: basic plpgsql / sql funtion question
Previous Message Kynn Jones 2008-03-11 18:14:52 Re: ISO something like "#if 0 ... #endif" for SQL code