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

Home -> Community -> Usenet -> c.d.o.tools -> Re: to_date function won't format properly

Re: to_date function won't format properly

From: R. Dickhout <Reinier_Dickhout_at_hetnet.nl>
Date: Mon, 4 Dec 2000 08:34:39 +0100
Message-ID: <#fbybTcXAHA.332@net003s>

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_



08:00-05:00

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

Original text of this message

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