sum columns in report

IOI

Registered User.
Local time
Today, 20:21
Joined
Oct 12, 2007
Messages
25
I tried to find the answer to this, I think simple for expert, question on the forum but coudn't.

A report is created from query. I would like just sum up each of two columns with numbers. Which fuction I should use? (they called H and O btw)

Thank you in advance
 
Put two text boxes on the report, in the appropriate footer or footers (you can use the same formula for each group/page footer and it will give you a total based on what the grouping is.

=Sum(Nz([YourFieldNameHere],0))

Now, make sure your control that shows your field on the report is not named the same as the field name (which is the default when you use the wizard to create a report).

So for example, you might have field with the name Amount and because you used the wizard there is a text box that is bound to Amount and it is named Amount as well. Change the text box name to txtAmount and save and then put in the totals text box on the report and use the formula (in the control source of the text box):
=Sum(Nz([Amount],0))

The reason I used the NZ function is to handle nulls which, if there are any in the Amount field, would cause an #Error to occur.

Hope that helps.
 
Thanks a lot. It works excellent.
 
Glad we could help :)
 

Users who are viewing this thread

Back
Top Bottom