how can I caclulate the sum of a sum in a report?

W

wigla

I am using an access report to create an invoice. I calculate the prices for
each class of a student and then sum the charges for each student in a
student footer. I now want to calculate the total charges for the family by
suming all the student charges in a family footer. When I do, I get an error
message cannot use an aggregate function in an aggregate. If I try using the
field names from the student footer, they are not recognized. How can I
complete this sum of a sum?
 
B

BruceM

If you have a student group footer, then a family group footer, you should
be able to repeat in the family footer the calculation used in the student
footer. If the family grouping includes the relevant students (that is, if
student is a sort of sub-group within family) this should perform the
aggregate calculation for all students within the family.
It might have helped had you included the actual calculation. In general
you should post the code or expression that is giving you problems.
 
W

wigla

The problem is that I calculate a rebate for each student based on how many
classes they take. The sum of the rebates gives a wrong answer.

I work in design view. In the student group footer I have:

[Sum of KlassTotal] = Sum([Price]*[WeeksOfTerm])
[Student Rebate] = [Sum of
KlassTotal]*Choose(Sum([Rabatwert]);0;0.15;0.25;0.35;0.45)
[Student Total] =[Sum of KlassTotal]-[Student Rebate]

If I use [FamilieSubTotal]
=Sum([Price]*[WeeksOfTerm])-Sum([Price]*[WeeksOfTerm])*Choose(Sum([Rabatwert]);0;0.15;0.25;0.35;0.45)
in the family group footer, the rebate is wrong. Is there another way to do
this?

When I have the family subtotal, I calculate a family rebate before I have
the total invoice.
 

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