PDA

View Full Version : Calculating Days,Hours & Minutes From Two Dates



mattster1010
08-19-2008, 03:45 AM
Hi All,

I recentley found a formula that could show the elapsed time in hours & minutes by referencing a field that had a total minutes calculation, Text38 in this example. (See formula below)

=[Text38]\60 & Format([Text38] Mod 60,"\:00")

This would return for example 23:56, whenever the minutes went over 60 adding +1 to the hour as time should do. However now I need a formula that would add a day if the hours elasped added to greater than 24, example 1:23:56.

Could this be done by simply adjusting the above formula?

Regards,

Matt

CreganTur
08-19-2008, 06:58 AM
Have you tried using DateDiff? You'd need to use it 3 different times; get the difference in days, the difference in hours, and difference in minutes. Then you could concatenate those three pieces together to get the format you want.

It might take a little finagling, but it might solve your issue.

HTH:thumb

Carl A
08-19-2008, 12:45 PM
Give this a whirl!
=[Text38]\1440 & Format([Text38] Mod 24,"\:00") & Format([Text38]\24 Mod 60,"\:00")

Please note that this is integer division!


5000 minutes should return
3:08:28

Looks a little confusing most would associate this format with hours/min/sec:bug: