Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
deepak4wd

New User

Joined: 24 Apr 2006
Posts: 4

 Posted: Mon Sep 10, 2007 8:40 pm    Post subject: Find date and time difference in DB2 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

Craq Giegerich

Senior Member

Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

Posted: Mon Sep 10, 2007 9:30 pm    Post subject: Re: date and time difference

 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.
deepak4wd

New User

Joined: 24 Apr 2006
Posts: 4

 Posted: Tue Sep 11, 2007 10:34 am    Post subject: Reply to: Find date and time difference in DB2 Thanx a lot !!!
gagandeep

New User

Joined: 22 Jul 2008
Posts: 3
Location: India

 Posted: Sat Nov 29, 2008 1:08 pm    Post subject: Reply to: Find date and time difference in DB2 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.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am How syntax check at Bind time is diff... Poha Eater DB2 5 Wed Mar 21, 2018 9:16 pm Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm Merging records, but not all the time prino DFSORT/ICETOOL 17 Sat Feb 17, 2018 4:20 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us