IIF Function & Calculation

M

MB1

Here's my problem: I'm trying to calculate a sales commission. This is the
function I'm trying to use.

AH Sales: IIf([Sales Log]![AH Sale]=1,"[GP]*0.5","")

AH is the salesman, AH Sale is a yes/no type field. GP is the gross
profit/commission that is calculated in the query. If the statement is false,
I just need it to be blank.
Right now, the calculation isn't working. I'm getting [GP]*0.5 in the field
instead of a number.
Any help would be much appreciated.
 
D

Douglas J. Steele

Remove the quotes for the first part, and replace them with Null for the
second part:

AH Sales: IIf([Sales Log]![AH Sale]=1, [GP]*0.5, Null)

Actually, if GP is a calculated field, you'll need to replace [GP] with the
calculation.
 

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