ashwin ashwin - 1 year ago 143
SQL Question

Multiple IIF Criteria in Access

I have two fields

. I want an
condition together to form a field

I am trying to combine two following conditions :

IIF(A AND B) IS not NULL,0,0) As Col

IIF(A Is not NULL AND B IS NULL),1,0) As Col

How Can I combine these two conditions to form the field Col?

Answer Source

General code example to fit with the original question:

IIF((Not IsNull(A) AND Not IsNull(B)),0,IIF((Not IsNull(A) AND B IS NULL),1,0))

Specific answer for your code:

IIF((Not IsNull(Laufzettel.EPolicierungVSL) AND Not IsNull(Laufzettel.DAnlageSchwebeVSL)),0,IIF((Not IsNull(Laufzettel.EPolicierungVSL) AND Laufzettel.DAnlageSchwebeVSL IS NULL),1,0)) AS dunkel

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download