IIF Function & Calculation

  • Thread starter Thread starter MB1
  • Start date Start date
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.
 
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.
 
Back
Top