to_date() confusion - Mailing list pgsql-sql

From Richard Rowell
Subject to_date() confusion
Date
Msg-id 1042037339.25939.63.camel@localhost
Whole thread Raw
Responses Re: to_date() confusion  (Bruno Wolff III <bruno@wolff.to>)
List 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@bowmansystems.com>



pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Search and Replace
Next
From: Bruno Wolff III
Date:
Subject: Re: to_date() confusion