to_date() confusion

From: Richard Rowell <richard(at)bowmansystems(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: to_date() confusion
Date: 2003-01-08 14:49:00
Message-ID: 1042037339.25939.63.camel@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I'm confused. How do I massage the integer 10102 into the date
2002-01-01?

cmi=> select to_date('010102','MMDDYY');
to_date
------------
2002-01-01
(1 row)

cmi=> select to_char(10102,'000000');
to_char
---------
010102
(1 row)

cmi=> select to_date(to_char(10102,'000000'),'MMDDYY');
to_date
------------
2010-01-10
(1 row)

TIA!

--
Richard Rowell <richard(at)bowmansystems(dot)com>

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2003-01-08 14:56:23 Re: Search and Replace
Previous Message Randy D. McCracken 2003-01-08 14:02:47 Search and Replace