IIF Query help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an IIF query that currently looks like this:

GlobalType: IIf([SuperCircuit_IDs].[Type] Is Not
Null,[SuperCircuit_IDs].[Type],[Customers].[Type])

I need to add one more argument. I have another query named "Affiliate"
with a CustomerName field. If this field is not null, I want the GlobalType
to be "Affiliate", otherwise, the same rules as shown above.

1. SuperCircuit_IDs.Type is first choice
2. Customers.Type is second choice
3. But if Affiliate.CustomerName is not null, then "Affiliate"
Otherwise, 1 or 2.

Can this be done?

Thanks! Mary
 
Use a nested IIF (Don't forget an extra closed bracket at the end)

GlobalType: IIf([Affiliate].[CustomerName] Is Not Null,"Affiliate", IIf
[SuperCircuit_IDs].[Type] Is Not
Null,[SuperCircuit_IDs].[Type],[Customers].[Type]))
 
Back
Top