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!

How retrieve the number of days from a number

569536Dec 10 2009 — edited Dec 10 2009
Hi everybody, starting from a number X, I need to retrieve the number of days.
For example:

X = 10 -> number of days = 0
X = 12 -> number of days = 0,5
X = 24 -> number of days = 1
X = 25 -> number of days = 1
X = 34 -> number of days = 1
X = 36 -> number of days = 1,5
X = 37 -> number of days = 2
X = 72 -> number of days = 3
X = 70 -> number of days = 3

I tried with ROUND(X) but it didn't work as I wanted, because with 36 it retrieve 2 (instead of 1,5).
Practically, half a day (12 hours) have to be considered ALWAYS as 0,5 and NOT rounded.

Any idea ?
Thanks in advance

Alex
This post has been answered by 584412 on Dec 10 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 7 2010
Added on Dec 10 2009
9 comments
574 views