Time Averages

G

Guest

I have a list of customers and each customer can have a number of processes
lasting different times. On my report, I can average each customers processes
and get an average time by using in the Customer footer of my report:
=Int(Avg(qryCARR!DurationInMinutes/60)) to get the number of hours, and:
=(Avg(qryCARR!DurationInMinutes/60)-[AvgHrs])*60 to get the number of
minutes, and it seems to work ok. However, when I use the same expressions in
the Report footer to average all my customers, I get strange resyults at
times, like: 4 hrs 62 mins!

Any help would be gratefully received.

Thanks
 
J

John Spencer

Your formulas shoud be

Int(Avg(DurationInMinutes)) / 60) for the hours
Int(Avg(DurationInMinutes)) Mod 60 for the minutes
or
CInt(Avg(DurationInMinutes)) / 60) for the hours
CInt(Avg(DurationInMinutes)) Mod 60 for the minutes

That is you should calculate the average number of minutes, strip off the
decimal portion, and then break that into hour and minutes

If you wanted to round this up or down then use CInt otherwise use Int.

If the calculated average were 119.8 minutes
1 hour 59 minutes (Using Int)
2 hours 0 minutes (using Cint)

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
G

Guest

Thank you very much, just what the doctor ordered!

John Spencer said:
Your formulas shoud be

Int(Avg(DurationInMinutes)) / 60) for the hours
Int(Avg(DurationInMinutes)) Mod 60 for the minutes
or
CInt(Avg(DurationInMinutes)) / 60) for the hours
CInt(Avg(DurationInMinutes)) Mod 60 for the minutes

That is you should calculate the average number of minutes, strip off the
decimal portion, and then break that into hour and minutes

If you wanted to round this up or down then use CInt otherwise use Int.

If the calculated average were 119.8 minutes
1 hour 59 minutes (Using Int)
2 hours 0 minutes (using Cint)

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Nigel said:
I have a list of customers and each customer can have a number of processes
lasting different times. On my report, I can average each customers
processes
and get an average time by using in the Customer footer of my report:
=Int(Avg(qryCARR!DurationInMinutes/60)) to get the number of hours, and:
=(Avg(qryCARR!DurationInMinutes/60)-[AvgHrs])*60 to get the number of
minutes, and it seems to work ok. However, when I use the same expressions
in
the Report footer to average all my customers, I get strange resyults at
times, like: 4 hrs 62 mins!

Any help would be gratefully received.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Summarizing Grouped Data 2
Using "Avg" function on calculated field 3
Sum of Time 1
Averaging sums 3
Date/Time Average?? 7
Eliminate Group Footer 4
Microsoft Access 1
Percentages on time calculations 3

Top