Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: to_date function won't format properly
select to_char(to_date(substr('08001700',1,4),'hh24mi'),'hh12:mi')
||'-'||
to_char(to_date(substr('08001700',5,4),'hh24mi'),'hh12:mi')
from dual
/
this statement will give you:
TO_CHAR(TO_
this result
Hope this helps.
Reinier.
Roy Mercer <wb5wzm_at_flash.net> wrote in message
news:3A2B5187.1B7F664D_at_flash.net...
> I have a column (time) as varchar2(8) and it stores time in military
> format. ie. 08001700. The first 4 digits are the start time and the
> last four are the ending time. In my report I want the time to display
> like this 08:00-05:00pm. I know to_date should be the method but I have
> not been successful in formatting it properly. Thanks for the help.
>
Received on Mon Dec 04 2000 - 01:34:39 CST
![]() |
![]() |