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

Home -> Community -> Usenet -> c.d.o.server -> Re: rounding to a quater of an hour (hh:15, hh:30,hh:45,hh:00)

Re: rounding to a quater of an hour (hh:15, hh:30,hh:45,hh:00)

From: Martin Doherty <martin.doherty_at_oracle.comX>
Date: Wed, 23 Oct 2002 17:29:51 -0700
Message-ID: <dfHt9.2$Jj1.210@news.oracle.com>


Alternatively:

trunc(sysdate) + round((sysdate - trunc(sysdate)) * 96) / 96

Martin Doherty

J Alex wrote:

>"Sybrand Bakker" <gooiditweg_at_sybrandb.demon.nl> wrote in message
>news:amldrug8gh4b58s6g59kf84tqg2i9af9fu_at_4ax.com...
>
>
>>On Wed, 23 Oct 2002 16:12:29 GMT, andreyNSPAM_at_bookexchange.net
>>(NetComrade) wrote:
>>
>>
>>
>>>any idea how? (besides writing a function)
>>>
>>>Thanx.
>>>.......
>>>We use Oracle 8.1.7.3 on Solaris 2.7 boxes
>>>remove NSPAM to email
>>>
>>>
>>trunc(sysdate)
>>+to_number(to_char(sysdate,'HH24'))/24
>>+(mod(to_number(to_char(sysdate,'MI'
>> ),15
>> )*15)/3600
>>
>>
>>
>Not quite.
>
>TO_CHAR(TRUNC(SYSDATE,'HH')
>+(15*ROUND(TO_NUMBER(to_char(sysdate,'MI'))/15))/(60*24)
>,'DD-MON-YYYY HH24:MI')
>
>
>
>
Received on Wed Oct 23 2002 - 19:29:51 CDT

Original text of this message

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