Reporting an Average

  • Thread starter pushrodengine via AccessMonster.com
  • Start date
P

pushrodengine via AccessMonster.com

How do I average the field “Minutes†from the query “qryUrban†and display
the average in a report?

I would like to find the (mean) average, but I have no experience with the
AVG function.

Thanks
 
M

Marshall Barton

pushrodengine said:
How do I average the field “Minutes” from the query “qryUrban” and display
the average in a report?

I would like to find the (mean) average, but I have no experience with the
AVG function.


Without seeing your query, if the query is the report's
record source and if the Minutes field is an integer, then
you can use a text box in the report's header or footer
section. The text box espression would just be:
=Avg(Minutes)
 
P

pushrodengine via AccessMonster.com

Marshall,

The report is made up of several queries. The Minutes query is not the record
source.
 
P

pushrodengine via AccessMonster.com

No Luck.

Is there anything else I can do to find Average?

Thanks for the Response.


Marshall said:
Try using:

=DAvg("Minutes", "qryUrban")
The report is made up of several queries. The Minutes query is not the record
source.
[quoted text clipped - 10 lines]
 
M

Marshall Barton

Is there anything else I should know about the report and
these queries that might help explain why you are not having
any luck?
--
Marsh
MVP [MS Access]

No Luck.

Is there anything else I can do to find Average?


Marshall said:
Try using:

=DAvg("Minutes", "qryUrban")
The report is made up of several queries. The Minutes query is not the record
source.
[quoted text clipped - 10 lines]
section. The text box espression would just be:
=Avg(Minutes)
 
P

pushrodengine via AccessMonster.com

The only thing I could think that might cause a problems is that "Minutes" is
a calculated value within the query.
 
M

Marshall Barton

Please provide more information about how your report is
organized, how it relates to the avg calculation and the
Copy/Paste of the SQL statement of the query that provides
the calculations that you want to average. Also, please
explain what was wrong with the result of using the DAvg
function.
 
P

pushrodengine via AccessMonster.com

The query “qryUrban†looks up data by a location criteria specified by a list
of locations determined to be urban. The query displays each record that
meets the criteria. Then the “Minutes†or difference of two time fields “10-
97TimeStd†and “10-8TimeStd†within the query “qryUrban†are found by the
expression:

Minutes: DateDiff("n",[10-8TimeStd],IIf([10-97TimeStd]<[10-8TimeStd],DateAdd
("d",1,[10-97TimeStd]),[10-97TimeStd]))
Please provide more information about how your report is
organized, how it relates to the avg calculation

Now I need to some how average (mean) the “Minutes†of all the records listed
in the query “qryUrban†and display the results of the average in the report
“rptActivityReport†as a textbox label “Urban Response Averageâ€.


Thank for your help!
 
M

Marshall Barton

pushrodengine said:
The query “qryUrban” looks up data by a location criteria specified by a list
of locations determined to be urban. The query displays each record that
meets the criteria. Then the “Minutes” or difference of two time fields “10-
97TimeStd” and “10-8TimeStd” within the query “qryUrban” are found by the
expression:

Minutes: DateDiff("n",[10-8TimeStd],IIf([10-97TimeStd]<[10-8TimeStd],DateAdd
("d",1,[10-97TimeStd]),[10-97TimeStd]))
Please provide more information about how your report is
organized, how it relates to the avg calculation

Now I need to some how average (mean) the “Minutes” of all the records listed
in the query “qryUrban” and display the results of the average in the report
“rptActivityReport” as a textbox label “Urban Response Average”.


That is about what I thought when I suggested using DAvg.
If you are sure that minutes calculation is correct, then
there must be something more to it or it should have worked.

BTW, you never did say what was wrong with the result of
using DAvg. If you could explain the discrepency with a
small set of sample data along the DAvg result and the
result you expected, it might help point the way to a
solution.
 
P

pushrodengine via AccessMonster.com

Marshall,

Thank you for all of your help. With your help I figured it out.

Thanks again!
 

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

Top