Thread: to_date confusion

to_date confusion

From
Richard Rowell
Date:
I'm confused.  How do I get the integer 10102 to come in as 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!



Re: to_date confusion

From
Josh Berkus
Date:
Richard,

> I'm confused.  How do I get the integer 10102 to come in as the date
> 2002-01-01?

Hmmm ... isn't this an old post, repeating?

--
-Josh BerkusAglio Database SolutionsSan Francisco



Re: to_date confusion

From
Stephan Szabo
Date:
On Mon, 13 Jan 2003, Josh Berkus wrote:

> Richard,
>
> > I'm confused.  How do I get the integer 10102 to come in as the date
> > 2002-01-01?
>
> Hmmm ... isn't this an old post, repeating?

Yep, my guess is that he sent it, wasn't on the list so it went for
approval, he joined and resent, and we're now getting the approved
version of it (given that I just received a bunch of messages
with dates about a week ago)