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

2008-03-11 Thread Thomas Kellerer
A. Kretschmer wrote on 11.03.2008 19:50: am Tue, dem 11.03.2008, um 10:51:21 -0700 mailte CaseT folgendes: Hi All, I'm a novice but learning quickly and I'm stumped on how to do this. I need to convert postgres timestamp to date format -mm-dd in a sql statement. pt.created_date below is t

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

2008-03-11 Thread Tom Lane
Vivek Khera <[EMAIL PROTECTED]> writes: > 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

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

2008-03-11 Thread Vivek Khera
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

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

2008-03-11 Thread A. Kretschmer
am Tue, dem 11.03.2008, um 10:51:21 -0700 mailte CaseT folgendes: > Hi All, > > I'm a novice but learning quickly and I'm stumped on how to do this. > > I need to convert postgres timestamp to date format -mm-dd in a > sql statement. > pt.created_date below is timestamp format > > i.e ... W

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

2008-03-11 Thread Adam Rich
> I need to convert postgres timestamp to date format -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 -- Sent v

[GENERAL] How to convert postgres timestamp to date: yyyy-mm-dd

2008-03-11 Thread CaseT
Hi All, I'm a novice but learning quickly and I'm stumped on how to do this. I need to convert postgres timestamp to date format -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. Thanks