Using IIF Statement in Report

A

AuditorCMM

I have a table similar to the following:

Name Course Credits Qualifies (check box)
Smith Audit 8 yes
Jones Tax 8 no

At the bottom of the report, I have a text box with a formula to total the
number of credits, but I would like to have another box that would total
only the credits for the courses that qualify. I tried the following
formula, but it is not working:

IIF((Qualifies = true), SUM(Credits),0)

Any thoughts on what I need to do to make this work?

Thanks.
 
J

John Spencer

Close, try the following

=Sum(IIF(Qualifies = True, Credits, Null))

or a bit more esoteric
=Abs(Sum(Qualifies * Credits))

Multiplies credits by -1 (true) or 0
Sums that
and finally removes the sign with the Abs function
 
A

AuditorCMM

Great. Thanks!

John Spencer said:
Close, try the following

=Sum(IIF(Qualifies = True, Credits, Null))

or a bit more esoteric
=Abs(Sum(Qualifies * Credits))

Multiplies credits by -1 (true) or 0
Sums that
and finally removes the sign with the Abs function
 
Top