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!

Hint on date problem

757169May 31 2012 — edited May 31 2012
Hi all,

I'm stuck on the following problem:

SELECT ( TO_DATE ('13.06.2012 03:10:00', 'DD.MM.YYYY HH24:MI:SS')
- TO_DATE ('06.06.2012 23:15:00', 'DD.MM.YYYY HH24:MI:SS'))
FROM DUAL

Why the difference is 6.163 .. and not greater than 7 ? There are more than 7 days between, no ?

select TO_DATE ('06.06.2012 23:15:00', 'DD.MM.YYYY HH24:MI:SS') + 6,16319444444444 from dual

12.6.2012 23:15:00

And what is going on here ? If I add the number of days from the query above and add it to the smaller date from the above query the result is smaller that expected.

Could anyone please give me a hint and explain this behavior to me ?

Thank you very much in advance!

Michael
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2012
Added on May 31 2012
6 comments
166 views