P
prodeji
Hi everyone
I'm trying to write a nested IIF statement to calculate commission for
an ROI report.
The particulars are:
If revenue <=0, commission = $0.00.
If revenue between 0 and $166999.00, commission = [revenue * 0.15]
If revenue >= $167000.00, commission = $25000.00
I first tried using IIF(Test, IIF(Test, when true, when false),when
false) to nest the statements:
IIF(([TableWL]+[SlotsWL])>0, IIF([TableWl+SlotsWL]>167000,25000,
[TableWl+SlotsWL]*0.15),0)
Then I tried scrapping the 'else' for the outer IIF and just writing
all three conditions 'straight':
IIF([TableWL]+[SlotsWL]<=0,0), IIF([TableWL]+[SlotsWL] between 0 and
166999, [TableWl+SlotsWL]*0.15), IIF([TableWl+SlotsWL]>167000,25000)
On the first I get an error message that says "Extra ) in query
expression".
On the second I get an "Syntax error (comma) in query expression"
message.
To the best of my knowledge there is nothing wrong with the query or
syntax.
Can anyone show me the error of my ways?
Thanks,
prodeji
I'm trying to write a nested IIF statement to calculate commission for
an ROI report.
The particulars are:
If revenue <=0, commission = $0.00.
If revenue between 0 and $166999.00, commission = [revenue * 0.15]
If revenue >= $167000.00, commission = $25000.00
I first tried using IIF(Test, IIF(Test, when true, when false),when
false) to nest the statements:
IIF(([TableWL]+[SlotsWL])>0, IIF([TableWl+SlotsWL]>167000,25000,
[TableWl+SlotsWL]*0.15),0)
Then I tried scrapping the 'else' for the outer IIF and just writing
all three conditions 'straight':
IIF([TableWL]+[SlotsWL]<=0,0), IIF([TableWL]+[SlotsWL] between 0 and
166999, [TableWl+SlotsWL]*0.15), IIF([TableWl+SlotsWL]>167000,25000)
On the first I get an error message that says "Extra ) in query
expression".
On the second I get an "Syntax error (comma) in query expression"
message.
To the best of my knowledge there is nothing wrong with the query or
syntax.
Can anyone show me the error of my ways?
Thanks,
prodeji