Home » SQL & PL/SQL » SQL & PL/SQL » how to find the difference between two dates
how to find the difference between two dates [message #19914] Thu, 18 April 2002 03:40 Go to next message
Kannan
Messages: 29
Registered: September 2000
Junior Member
hi all,
Please tell me how to find the difference between two dates inclusive of times.

for eg. 04-apr-2002 08:32:40 pm minus
04-apr-2001 10:32:34 am

Thanks
Kannan
Re: how to find the difference between two dates [message #19915 is a reply to message #19914] Thu, 18 April 2002 03:57 Go to previous message
Mike
Messages: 417
Registered: September 1998
Senior Member
if you substract two values of the datatype date you get the difference in number of days. So if you do date1-date2 where date1 = 04-apr-2002 08:32:40 pm and date2 = 04-apr-2001 10:32:34 am you get something like
0.416 because there is a difference of 10 hours which is 10/24 of a day. To get the number of hours you just have to multiply it by 24.

Hope that helps
Mike
Previous Topic: Access to Oracle sql conversion
Next Topic: Numeric Data Type
Goto Forum:
  


Current Time: Fri Mar 29 03:00:49 CDT 2024