Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i HAVE T FIELDS IN MY DATABASE,THAT

Status
Not open for further replies.

caseye111

Programmer
Apr 15, 2002
1
IE
i HAVE 2 FIELDS IN MY DATABASE,THAT CONTAIN TWO DIFFERENT TIMES IN THE FORM HH:MM:SS.I WANT TO CALCULATE THE DIFFERNCE BETWEEN THE TWO
SAY TIME1=01:30:00
AND TIME2=03:00:00
THEM THE TIME DIFFENECE WILL BE 01:30:00
ONCE I HAVE THIS DONE I WANT TO BE ABLE TO CONVERT IT TO MINUTES SO 01:30:00 WILL BECOME 90 MINUTES ANY IDEAS
 
I'm not sure what time functions you have with your RDBMS but I would do this, using DB2:

select minute(time1 - time2) + (hour(time1 - time2) * 60)
from time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top