Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Find date and time difference in DB2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
deepak4wd

New User


Joined: 24 Apr 2006
Posts: 4

PostPosted: Mon Sep 10, 2007 8:40 pm    Post subject: Find date and time difference in DB2
Reply with quote

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
View user's profile Send private message

Craq Giegerich

Senior Member


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

PostPosted: Mon Sep 10, 2007 9:30 pm    Post subject: Re: date and time difference
Reply with quote

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
View user's profile Send private message
deepak4wd

New User


Joined: 24 Apr 2006
Posts: 4

PostPosted: Tue Sep 11, 2007 10:34 am    Post subject: Reply to: Find date and time difference in DB2
Reply with quote

Thanx a lot !!!
Back to top
View user's profile Send private message
gagandeep

New User


Joined: 22 Jul 2008
Posts: 3
Location: India

PostPosted: Sat Nov 29, 2008 1:08 pm    Post subject: Reply to: Find date and time difference in DB2
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. 00D3003B - time outs in DB2 when invo... chavinash2004 DB2 2 Mon Oct 09, 2017 4:39 pm
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us