Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting my output in a subtraction from 2 timestamps

Status
Not open for further replies.

Larshg

Programmer
Mar 1, 2001
187
DK
HI

I have this SQL - that subtracts 2 dates from each other

select ((sysdate -(select max(channel_time) FROM prepaid.sms_rating_transactions_v4)))
from dual;

I'd like the output to be number of hours and minutes

Thanks

Larshg
 
In ANSI SQL it's
select (TimeStamp1 - TimeStamp2) hour to minute

AFAIK Oracle supports Interval Expressions, too.

Dieter
 
What I want is to have the output as the number og hours and minutes between the timestamps.

ex.
select ((sysdate -(select max(channel_time) FROM prepaid.sms_rating_transactions_v4)))
from dual;

output now is
0,0066087962962963

output should be
0 hours 6 minutes

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top