Average a column in a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have built a database to track our explosive ordinance disposal team. Two
of the fields are Time Reported and time Responded. In a query I have
imported tehse two fields along with the incident ID, I then made another
field which calculates the time difference in minutes. On the bottom of the
report, in the foote I would like to display the average of these reponse
times. In a text box I have the following expression: =Avg([Response Time])
When I go to form view I get: #Error
Can onyone help me out? Thank you.
 
Engineer Captain said:
I have built a database to track our explosive ordinance disposal team.
Two
of the fields are Time Reported and time Responded. In a query I have
imported tehse two fields along with the incident ID, I then made another
field which calculates the time difference in minutes. On the bottom of
the
report, in the foote I would like to display the average of these reponse
times. In a text box I have the following expression: =Avg([Response
Time])
When I go to form view I get: #Error
Can onyone help me out? Thank you.

You have to repeat the calculation in the Avg function.

Example: If Response Time is calculated by [Time Responded] - [Time
Reported]
then instead of Avg([Response Time]) use
Avg([Time Responded] - [Time Reported])

Tom Lake

Tom Lake
 
Try a text box with its Control Source property set to:
=Avg(DateDiff("n", [Time Reported], [Time Responded])

Make sure the Name of this text box is not the same as the name of any field
in the report. For example, it cannot be named Time Reported.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
Back
Top