Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help with my to_date function
emdproduction_at_hotmail.com wrote:
> Group,
>
> I need to change a string of 6 in the format of 'yymmdd' to date. If
> yy< 07, i need to put 20 in front of it. If yy<07, I need to put 19 in
> front of it.
>
> So,
> 040102 needs to be 20040102
> while
> 320102 needs to be 19320102.
>
> Thanks for your help.
So what is the problem?
UT1 > select
2 to_date(case when substr('040102',1,2) < '07' then
'20'||'040102'
3 else '19'||'040102' 4 end, 'YYYYMMDD')
TO_DATE(C
3 else '19'||'320102' 4 end, 'YYYYMMDD')
TO_DATE(C
HTH -- Mark D Powell -- Received on Mon Oct 02 2006 - 08:36:27 CDT
![]() |
![]() |