I am trying to calculate a SUM in an MS Access report the following way:
Group1header - label
- Group2header - value
- Detail - example
- Detail - example
- Group2header - value
- Detail - example
- Group2header - value
Group1footer [sum of Group2header value]
Somehow, when more detail rows appear, the sum in group1footer is incorrectly calculated (adds value for each detail).
I can not calculate the sums in the query, because the "value" is already a calculated in the query (a subquery would return to many rows):
(
(
(sl_ticketdetail.weight,0) * sl_ticketdetail.amount
- (
SELECT SUM(sl_invoicedetail.amount)
FROM sl_invoicedetail
WHERE ticketdetailid = sl_ticketdetail.ticketdetailid
)
/ 1000
)
* sl_ticketdetail.cost
)
/ 1000
Thanks for your reactions.