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: Query: calculating the hour, on the hour

Re: Query: calculating the hour, on the hour

From: fumi <fumi_at_tpts5.seed.net.tw>
Date: 12 Oct 1999 16:04:48 GMT
Message-ID: <7tvm70$d38$1@news.seed.net.tw>

<jwilkes66_at_my-deja.com> wrote in message news:7tt0r6$mg$1_at_nnrp1.deja.com...
> 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

select to_char(sysdate-1/24, 'HH24') from dual; Received on Tue Oct 12 1999 - 11:04:48 CDT

Original text of this message

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