Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: date question
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
![]() |
![]() |