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 DAY TO SECOND to NUMBER

681516Jan 23 2009 — edited Jan 23 2009
I am receiving the following error when I try converting and Interval to a Number, and inserting into a NUMBER feild.

SQL:

-- the CreatedDate and usage Date are DateTime format 'yyyy-MM-dd HH:MI:ss'
update SOMETHING set Elapsed_Hrs_Accnt_Creation =
(
TO_NUMBER(TRUNC((CreatedDate - UsageDate)*24))
) where id = id


Error:
ORA-00932: inconsistent datatypes: expected NUMBER got INTERVAL DAY TO SECOND


Any suggestions on what I am doing wrong would be greatly appreciated.

Thanks.
This post has been answered by 283014 on Jan 23 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 20 2009
Added on Jan 23 2009
2 comments
87,193 views