ashwin ashwin - 1 month ago 18
SQL Question

Multiple IIF Criteria in Access

I have two fields

A
and
B
. I want an
IIf
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

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

Comments