It is easier to start out with just the IIF() syntax, then add the conditions and expressions. It sounds like you want to use 2 nested IIF() statements. So start with:
Code:
IIF(condition, TRUE, FALSE)
Then add the second IIF():
Code:
IIF(condition, TRUE, IIF(condition, TRUE, FALSE))
Now add the condition for the first (outer) IIF():
Code:
IIF(Mid([WBCode],4,1)="D", TRUE, IIF(condition, TRUE, FALSE))
then the TRUE part:
Code:
IIF(Mid([WBCode],4,1)="D", ([WBCost]+[WBShipping])*[ExchangeRate],[WBCost]*[ExchangeRate]), IIF(condition, TRUE, FALSE))
the FALSE part is the nested IIF() function , so
now add the condition for the inner IIF(), then the TRUE clause and the FALSE clause:
Code:
IIF(Mid([WBCode],4,1)="D", ([WBCost]+[WBShipping])*[ExchangeRate],[WBCost]*[ExchangeRate]), IIF(condition, TRUE, FALSE))