Skip to Main Content

Oracle Database Discussions

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!

Precision of Oracle DATE data type ?

thrupassDec 19 2016 — edited Dec 23 2016

Hi, Expert

ORACLE 11.2.0.4

SQL*PLUS

SQL> desc log_table

NAME     TYPE

-------- --------------

PROG        VARCHAR(20)

BEGIN_TIME  DATE

END_TIME    DATE

I want to get elapsed time in seconds (END_TIME-BEGIN_TIME)

This is my query ...

    select prog,(END_TIME-BEGIN_TIME)*86400 from log_table;

but

    Some of returned rows are not integer (for example 11.0000000....0000002,   6300.99999999999999)

The precision of Oracle DATE data type is second ....

How can it(caculation of date type) be not integer ?

--- oracle concept manual

The DATE datatype stores the year (including the century), the month, the day, the hours, the minutes, and the seconds.

Thanks in advance

This post has been answered by Jonathan Lewis on Dec 20 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 17 2017
Added on Dec 19 2016
8 comments
3,642 views