Sum fields w/IIF?

G

Guest

I put an unbound text box on a report that uses an IIF statement to determine
which value to place into the box. It works for all the report detail
entries, but I can't get field to sum in the footer.

Is it possible to sum fields containing functions like IIf using "Sum
([field])" on a report?

As a workaround I've created a new field in the underlying query containing
the IIf, then just included the new field in the report. That works, but I'm
still wondering why the other approach did not. Any ideas? I'm using Access
2003. Is my application corrupt?
 
F

fredg

I put an unbound text box on a report that uses an IIF statement to determine
which value to place into the box. It works for all the report detail
entries, but I can't get field to sum in the footer.

Is it possible to sum fields containing functions like IIf using "Sum
([field])" on a report?

As a workaround I've created a new field in the underlying query containing
the IIf, then just included the new field in the report. That works, but I'm
still wondering why the other approach did not. Any ideas? I'm using Access
2003. Is my application corrupt?

=Sum(IIf([SomeField] = SomeCriteria,[SomeField],0))
will work BUT NOT if you place it in the Report's Page Footer.

If you want that total in the page footer, see Microsoft KnowledgeBase
article:
132017 'How to sum a column of numbers in a report by page"
 

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