View previous topic :: View next topic
|
Author |
Message |
deepak4wd
New User
Joined: 24 Apr 2006 Posts: 4
|
|
|
|
hi,
can any one plz help me. I have a request date and time , and response date and time. i need to find their difference in minutes in Db2 .. how shud i do it?
for ex- request date 5/08/07
request time 10:30:00
response date 6/08/07
response time 10:28:00 |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
deepak4wd wrote: |
hi,
can any one plz help me. I have a request date and time , and response date and time. i need to find their difference in minutes in Db2 .. how shud i do it?
for ex- request date 5/08/07
request time 10:30:00
response date 6/08/07
response time 10:28:00 |
You would have get the days and hours difference and after multiplication add in the minutes difference. Look in the sql manual under functions and date-time computations. |
|
Back to top |
|
|
deepak4wd
New User
Joined: 24 Apr 2006 Posts: 4
|
|
|
|
Thanx a lot !!! |
|
Back to top |
|
|
gagandeep
New User
Joined: 22 Jul 2008 Posts: 3 Location: India
|
|
|
|
this query would work i suppose..
SELECT timestampdiff (4, char(
timestamp('2007-08-06-10.30.00')-
timestamp('2007-08-07-10.28.00'))) FROM sysibm.sysdummy1
the numeric 4 is to calculate the minutes difference.
To get hours or days 8 and 16 can be used. |
|
Back to top |
|
|
|