Calculating two calculated fields

G

Guest

I have two calculated fields in a query, both being calculated by the
"Total:" row on the query. One is summing and the other is counting. I need
to calculate these two fields in order to create a percentage on a report.
The calculation I'm attempting is such: [SumOfField1]/[CountOfFieldA].
Field's 1 and A represent my summed and counted fields. When I do this,
Access gives me an error message stating that the fields cannot be found or
have been misspelled. Could this have to do with the fact that both fields
are being calculated in a query and their results are then being calculated
in a report? Any help you can give would be greatly appreciated.
Thanks,
Jason
 
J

John Vinson

I have two calculated fields in a query, both being calculated by the
"Total:" row on the query. One is summing and the other is counting. I need
to calculate these two fields in order to create a percentage on a report.
The calculation I'm attempting is such: [SumOfField1]/[CountOfFieldA].
Field's 1 and A represent my summed and counted fields. When I do this,
Access gives me an error message stating that the fields cannot be found or
have been misspelled. Could this have to do with the fact that both fields
are being calculated in a query and their results are then being calculated
in a report? Any help you can give would be greatly appreciated.
Thanks,
Jason

Your analysis is exactly correct.

Use

Percentage: Sum([Field1]) / Count([FieldA])

instead - that is, recapitulate the expression in each term of the
further calculation, rather than using a calculated field in a further
calculation.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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