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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Difference or Duration Calculation Issue

Status
Not open for further replies.

wcipolli

Technical User
Jun 11, 2010
13
US
I'm trying to get the difference in hours(float) between two dates. Say 5.2, when the two dates are 5 hours and 12 minutes apart.

Attempt one: date1 - date 2 (format time interval -> hours)

Attempt two: datediff ({hh}, date1, date2)

Both tries seem to just show the hours as an integer truncating the minutes.

Any help would be greatly appreciated.
 
Datediff will give the integer difference in the specified units; you'll need to get the difference in minutes ('mi')and then convert that into "decimal time" (dread expression!)

soi là, soi carré
 
cast_float (datediff ({ss},[POC_Layer].[Incidents].[OPEN_TIME],[POC_Layer].[Incidents].[CLOSE_TIME]))/3600

This ended up working. Thanks for the help though!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top