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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with date/time. How-to : 1

Status
Not open for further replies.

FORAND

Programmer
May 26, 2003
64
CA
hi

I have 2 sets of data :
Time of entry
Time of exit

Both data are varchar2(17), both data are something like this :
05/10/07 08:01:49
05/10/07 08:02:58

How can I find the time elapsed between "entry" and "exit"?

Thanks in advance

Forand
 
It depends what you want to measure the difference in but, assuming it's seconds, you would use:

Code:
select (to_date('05/10/07 08:02:58','DD/MM/YY HH24:MI:SS') - to_date('05/10/07 08:01:49', 'DD/MM/YY HH24:MI:SS')) * 86400
from dual
 
Thanks! That is exactly what I was looking for.
Star for you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top