Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: extracing the hour from a date
"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