Using IIF Statement in Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
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
 

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

Back
Top