HELP: Calculation of Minutes to HH:MM is Wrong

rlm

Retired Navy Veteran
Local time
Today, 12:13
Joined
Nov 25, 2011
Messages
18
Help. I have entered onto the Report Footer a calculation to add up all the estimated minutes on the report and convert them into HH:MM. Got close but it's off. For example: 360 minutes is being converted to 6 Hrs. 06 Min. This is the code I'm using:

="Total Estimated Time = " & Int(Sum([Est Time]/60)) & " Hrs. " & Format((Sum([Est Time]/60) Mod 60),"00") & " Min." :mad:
 
Untested, but I think you want the sum around just the field.
 
Are you talking about: Sum([Est Time]/60). That's how it's entered. I don't understand.
 
I was thinking

Sum([Est Time])/60
 
Still didn't work. This is frustrating. I can't understand why it didn't work.
 
Can you post a sample db here?
 
You want the remainder of minutes after divided by 60 not the remainder of the calculated hours (minutes/60) divided again by 60.

Sum([Est Time]) Mod 60

BTW you can use the integer divide (\):

x\y

is basically the same as:

Int(x/y)

Note though that x and y will be converted to integers first.
 
Last edited:
Well the only thing that I found out is when I removed the "SUM()" function, it works great. So thanks for your assistance. I just found a way around it by first using the "SUM()" function to gather the total and then taking that data and inputting it into the conversion formula.
 

Users who are viewing this thread

Back
Top Bottom