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: J Alex <jalexanderssd_at_yahoo.com>
Date: Wed, 23 Oct 2002 17:52:25 GMT
Message-ID: <tlBt9.28071$r7.742172@twister.tampabay.rr.com>

"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 - 12:52:25 CDT

Original text of this message

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