Aggregate functions on calculated fields

G

Gabriël123

I have in my detail section of my report a calculated field, something like [quantity]*5-quantity begin a field in a query. The name of the textbox is txtPrice and what I would like to do is get the sum of this textbox in the footer section of the report, but when is use somehting like sum([txtPrice]) it thinks its a user input.
 
A

Allen Browne

The simplest solution is probably to move the calculated field into the
query the report is based on. In query design view, a fresh column of the
Field row, enter your expression:
Price: [quantity]*5-quantity
You can now sum the Price field in the report.

Alternativley, repeat the expression in the box where you want to get the
sum:
=Sum([quantity]*5-quantity)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Gabriël123 said:
I have in my detail section of my report a calculated field, something
like [quantity]*5-quantity begin a field in a query. The name of the
textbox is txtPrice and what I would like to do is get the sum of this
textbox in the footer section of the report, but when is use somehting like
sum([txtPrice]) it thinks its a user input.
 
Top