to_date()

From: "Paul " <paul(at)operamail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: to_date()
Date: 2002-06-03 00:53:47
Message-ID: 20020603005347.29190.qmail@operamail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Can someone explain to me why this happens?
======
select to_date('2002-04-29 07:33:55.000','FXYYYY-MM-DD HH24:MM:SS.MS') as rebill_date;
rebill_date
-------------
2004-09-30
======

Ultimatly I'm doing a select into where the original field is of type "character varying".
Doing
======
select fieldname::date as rebill_date
======
generates a "ERROR: Cannot cast type 'character varying' to 'date'" error, but doing
======
select fieldname::text::date as rebill_date
======
seemes I think I've achieved what I want, but would still be interested in learning about to_date().

Thanks,

Paul
--
_______________________________________________
Download the free Opera browser at http://www.opera.com/

Powered by Outblaze

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2002-06-03 04:00:12 Re: Syntax error in plpgsql crashes backend
Previous Message Christopher Kings-Lynne 2002-06-02 18:01:27 Re: alternate idioms for large "IN (...)" lists