Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help with my to_date function
declare
aresult varchar2(10);
begin
select case when to_number(substr('&strdt',1,2)) <= 7
then '20'||'&strdt'
else '19'||'&strdt'
end
into aresult
from dual;
dbms_output.put_line ('result is: ' || aresult);
end;
<emdproduction_at_hotmail.com> wrote in message
news:1159794906.392366.237550_at_m7g2000cwm.googlegroups.com...
> 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.
>
Received on Mon Oct 02 2006 - 08:48:47 CDT
![]() |
![]() |