Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: date question

Re: date question

From: Martin T. <bilbothebagginsbab5_at_freenet.de>
Date: 3 Jul 2006 00:25:56 -0700
Message-ID: <1151911556.048244.99310@p79g2000cwp.googlegroups.com>

vijay_dwi_at_yahoo.com wrote:
> Hi,
>
> I have a string in the format ('MM/DD/YYYY)
> examples('12/12/2006') or ('2/12/2006') or ('12/1/2006') or
> ('1/1/2006') .
> Have to to take the date and lpad it with ZERO if its a single digit.
>
> Can you please let me know the sql ?
>

You could do:
select to_char(to_date('2/4/2006', 'MM/DD/YYYY'), 'MM/DD/YYYY') from dual

If you just want to insert the string into a date column, you may well skip the conversion back to char :)

best,
Martin Received on Mon Jul 03 2006 - 02:25:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US