joel impactor
joel impactor

Reputation: 1

How to do sum of a sum in access report?

I have one textbox as

    =[Price]*[Quantity]

and another as

    =Sum([Price]*[Quantity])

i need a third as

    =Sum(Sum([Price]*[Quantity]))

But i cant do the third as I cant do a sum of a sum, how can i work around this?

Upvotes: 0

Views: 472

Answers (1)

Olivier Jacot-Descombes
Olivier Jacot-Descombes

Reputation: 112259

You don't need to do that. Create nested group headers and footers and place the text boxes in the group headers or footers. Regardless of the nesting level, you can always use

=Sum([Price]*[Quantity])

as control source of the text box. Access knows what to sum up. The same works for the page footer as well.

Note that you don't have to make a sum of sums because

sum( sum(a, b, c), sum(d, e), sum(f, g, h, i) ) = sum(a, b, c, d, e, f, g, h, i)

i.e., the sum in a higher level group or in the report footer does not make a sum of sums, instead, it makes a sum of all involved items of all lower level groups.

Upvotes: 2

Related Questions