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

Similar Threads

calculating using the IIF statement 1
Sum IIF 3
using sum and Iif statement 6
IIF Statement 1
IIf for individual record 6
IIF Statment Syntax 3
IIf statement in a report 2
IIf Statement with null value 3

Top