Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Query: calculating the hour, on the hour
I need a query that returns the previous hour, on the hour.
Select to_char(to_char(sysdate, 'HH24')-1) from dual;
This query returns '7', but I need a query that will always return 2 characters ('07') and also will return '23' when it is midnight.
Thanks for any help,
JB
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Oct 11 1999 - 10:47:56 CDT