Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

interval(fraction of hour) in a day

Rosario VigilanteMay 21 2013 — edited May 21 2013
hello to all

I have a
select
to_date('16/08/2012 08:00','dd/mm/yyyy hh24:mi') + ((level-1)*15/24/60)
--when frazione <> 15  then to_date('16/08/2012 08:00','dd/mm/yyyy hh24:mi') + ((level-1)*20/24/60)
--end
Hours

from dual connect by level < 48
 and I got 

16/08/2012 08:00:00
16/08/2012 08:15:00
16/08/2012 08:30:00
16/08/2012 08:45:00
16/08/2012 09:00:00
16/08/2012 09:15:00
16/08/2012 09:30:00
16/08/2012 09:45:00
...
I ask me if possibile to get same result replacing the fraction with a variable ((level-1)*15/24/60), that is I can get the resul with all fraction of day, 10,15,20 minutes and so on , if I like 20 min I get

((level-1)*20/24/60) --- ((level-1)*&inthour/24/60)

16/08/2012 08:00:00
16/08/2012 08:20:00
16/08/2012 08:40:00
...

..

thanks in advance
This post has been answered by chris227 on May 21 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2013
Added on May 21 2013
7 comments
392 views