Time Calculation differece between query formula and report formual

Liz_I3

Well-known Member
Joined
Dec 30, 2002
Messages
647
Office Version
  1. 2016
Platform
  1. Windows
Hi
I am working in Access 2010
I have a totals query with this formula
Time In Hrs: Format(([Time]\60)+(CInt(([Time]-(60*([Time]\60)))/15)*15/60),"Fixed") this is grouped on Sum
Time is a field that is grouped on sum

If I put the Time In Hrs as an unbound field in a report instead of in the query and use this formula I get a difference of .25 on some of the calculations.

=Format(([SumOfTime]\60)+(CInt(([SumOfTime]-(60*([SumOfTime]\60)))/15)*15/60),"Fixed")

Example in the query 340 min converts to 6 hr. yet on the report it is 5.75

395 is query is 6.75 on the report 6.50

Could someone explain why the difference

Thanks very much
Liz
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I'm guessing, but i think CInt might be the problem. If it is what I think it is, it could be truncating to a whole number. Not sure how maths works in Access
 
Upvote 0
Thanks but if it was truncating would it not round up to 6, 7 etc. The difference I am getting is only .25 in many cases 6.75 vs 6.50

L
 
Upvote 0
OK I fixed it (I hope its correct) in the query instead of Time In Hrs: Sum(Format(([Time]\60)+(CInt(([Time]-(60*([Time]\60)))/15)*15/60),"Fixed"))
I changed it to Time In Hrs: Format((sum([Time])\60)+(CInt((sum([Time])-(60*(sum([Time])\60)))/15)*15/60),"Fixed"))
Seems like a small change but now it does match the same calculation in my report

Thanks
L
 
Upvote 0
glad you found a solution
 
Upvote 0

Forum statistics

Threads
1,215,729
Messages
6,126,524
Members
449,316
Latest member
sravya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top