Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How does Oracle handle hour ending - hour starting times Need help asap
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.comReceived on Tue Jun 17 2003 - 10:02:03 CDT