Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> subtracting date / time in SQL
I am trying to calculate the elapsed time for a connected session
Example:
select sysdate - logon_time from v$session where sid=35;
SYSDATE-LOGON_TIME
,278344907
Which is approximately 6 hours (a quarter of a day).
Now I want to display this in time format, I tried the following select to_char(sysdate - logon_time, 'HH:MI:SS') from v$session where sid=35
*
and also this
select to_char(to_date(sysdate - logon_time), 'HH:MI:SS') from v$session
where sid=35;
What am I doing wrong?
Thanks for helping me!
--
Syltrem
http://pages.infinit.net/syltrem (OpenVMS related web site)
To reply to myself directly, remove .spammenot from my address
Received on Mon Jun 11 2001 - 13:59:22 CDT