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 to find hours between sysdate and max of timestamp field

921326Jun 22 2012 — edited Jun 25 2012
Hi,
Could someone help me out of this query,when iam running thIs query iam getting this error
and query is

Select trunc((Sysdate - MAX(LASTMODIFIED))*24)||':'||trunc(Mod((Sysdate-MAX(LASTMODIFIED))*24*60,60))
From STATUS_CLAIMS;


ERROR:ORA-00932:INCONSISTENT DATATYPES:EXPECTED NUMBER
GOT INTERVAL DAY TO SECOND

ACTUALLY I NEED HOURS FROM SYSDATE MINUS MAX(LASTMODIFIED) DATE,
WHERE LASTMODIFIED FIELD IS IN TIMESTAMP DATATYPE AND IT IS HAVING DEFAULT OF SYSTIMESTAMP

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

Regards,
Vikram
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 23 2012
Added on Jun 22 2012
10 comments
1,677 views