Sum fields w/IIF?

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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"
 
Back
Top