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

From: Vivek Khera <vivek(at)khera(dot)org>
To: Postgres General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to convert postgres timestamp to date: yyyy-mm-dd
Date: 2008-03-11 20:28:12
Message-ID: 986B9CD2-F5CA-48FE-8BE4-4ACE742BD6D2@khera.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mar 11, 2008, at 2:50 PM, A. Kretschmer wrote:

>> i.e ... WHERE pt.created_date >= '2008-01-21'
>
> You can't compare a date or timestamp to a varchar or text. For your
> example, cast the date-string to a real date like:

Since which version of Pg?

Queries like the above have worked for me from 7.3 up thru 8.1, which
is my current production environment.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Colin Wetherbee 2008-03-11 20:35:14 Re: Array load from remote site through Perl/DBI
Previous Message Gauthier, Dave 2008-03-11 20:09:21 Array load from remote site through Perl/DBI