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

Home -> Community -> Usenet -> c.d.o.misc -> Re: extracing the hour from a date

Re: extracing the hour from a date

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Fri, 25 Mar 2005 19:45:36 +0100
Message-ID: <42445bfb$0$871$626a14ce@news.free.fr>

"Ed Prochak" <ed.prochak_at_magicinterface.com> a écrit dans le message de news:1111774464.949829.290960_at_o13g2000cwo.googlegroups.com...
| dang, I've been doing it the long way. So obvious now.
|
| It is strange that TRUNC has documented feature to truncate to hours or
| minutes, but cannot return the value with anything other than a time of
| 12AM.
|

I don't understand trunc with HH24 or MI works perfectly (WinNT4 9iR2):

SQL>select sysdate, trunc(sysdate,'MI'), trunc(sysdate,'HH24') from dual;

SYSDATE TRUNC(SYSDATE,'MI') TRUNC(SYSDATE,'HH24

------------------- ------------------- -------------------
25/03/2005 19:41:36 25/03/2005 19:41:00 25/03/2005 19:00:00

1 row selected.

Regards
Michel Cadot Received on Fri Mar 25 2005 - 12:45:36 CST

Original text of this message

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