MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Convert a Date into hours and minutes in DB2 SQL query...

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
vasukavi
Beginner


Joined: 17 May 2006
Posts: 1
Topics: 1

PostPosted: Fri Aug 11, 2006 9:17 am    Post subject: Convert a Date into hours and minutes in DB2 SQL query... Reply with quote

Hi..

I have two dates and would like to find out the difference of these dates in hours and minutes..

For example: I have a Report date : '2006/08/07 09:30:21' and Received date '2006/08/06 08:00:00'.. I want to find out the dfference in hours and minutes..

Is there any function in DB2 to get this? I wnat to write a query to get this and I really appreciate your help.

I have looked into the previous questions on the forum but could not find espeecially converting a date into hours and minutes..

Thank you and have a great day.

Vasu
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Aug 11, 2006 10:14 am    Post subject: Reply with quote

vasukavi,

The difference between two 2 timestamps gets tricker in terms of hours and minutes is way too complicated with the leap years and days in a month using just the SQl.

How about the using the Language environment calls as shown in here. The link has an example of calculating the difference between 2 timestamps.

http://www.mvsforums.com/helpboards/viewtopic.php?t=2261

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group