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

Home -> Community -> Usenet -> c.d.o.server -> Re: How does Oracle handle hour ending - hour starting times Need help asap

Re: How does Oracle handle hour ending - hour starting times Need help asap

From: andrewst <member14183_at_dbforums.com>
Date: Tue, 17 Jun 2003 15:02:03 +0000
Message-ID: <3011650.1055862123@dbforums.com>

Originally posted by Hourman
> In article , andrewst wrote:
> >Originally posted by Hourman
> >> we get a file every hour 24x7of the loads for the previous
> hour.
>
> >> any ideas?
> >If you want to see 24 rather than 00 for midnight, then either
> you will
> >have to format the time yourself, perhaps in a view, or store it
> in a
> >NUMBER or VARCHAR2 column, not a DATE.
> >You could format it yourself like this:
> >SELECT
> DECODE(TO_CHAR(timeval,'HH24'),'00','24',TO_CHAR(timeval,-
> >'HH24')) FROM ...
> problem is we need it as a date not as number or varchar
>
> other systems read this data and they are looking for a date field
>

In that case, my first suggestion applies: store it as a DATE, and use that DECODE statement to display it as you want. Hide the DECODE in a view and/or in a user-defined function as you wish. Your issue is with how you display the hour value, not how it is stored (in a DATE column, you have no control over how it is stored, nor do you need it).

--
Posted via http://dbforums.com
Received on Tue Jun 17 2003 - 10:02:03 CDT

Original text of this message

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