From: Paul <paul@operamail.com>
To: pgsql-sql@postgresql.org
Subject: to_date()
Date: Mon, 03 Jun 2002 10:53:47 +1000
Message-ID: <20020603005347.29190.qmail@operamail.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: paul@operamail.com
Subject: Re: to_date()
In-Reply-To: <20020603005347.29190.qmail@operamail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox