IIF statement on a report


S

Secret Squirrel

I have two fields on my report, one is "PaymentMethod" and the other is
"ExpenseAmount".

The PaymentMethod can be either "AMEX" or "CASH". How can I create an IIF
statement to sum the totals for each method?

I tried to create these two text boxes on my footer but it didn't seem to
work:

IIF([PaymentMethod]="AMEX",Sum([ExpenseAmount]),0)

IIF([PaymentMethod]="CASH",Sum([ExpenseAmount]),0)
 
Ad

Advertisements

S

Steve Schapel

Squirrel,

=Sum([ExpenseAmount]*IIf([PaymentMethod]="AMEX",1,0))

Slightly simpler, but perhaps less intuitive:

=Abs(Sum([ExpenseAmount]*([PaymentMethod]="AMEX")))
 

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