Could someone help me with this IIf statment?
See if this is the correct way to get the results for:
Code:
ProgramStatus: IIf([StatusID]<>3,"Inactive",IIf([StatusID]=3 And ([ProgramStatusID]=3),"Active","Active 0 Mbrshp"))
1. Active - StatusID =3 and ProgramStatusID = 3
2. Active w/ 0 mbs - StatusID = 3 and ProgramStatusID <> 3 or IsNull
3. Inactive - StatusID <> 3
it doesn't seem right.
I get this:
Code:
OrgTypeID OrgType ProgramStatus NoOfMbrshp
2 Basic Skills Program Active 642
2 Basic Skills Program Active 0 Mbrshp 82
2 Basic Skills Program Inactive 509
because when I remove the first part of the IIf I get this:
Code:
OrgTypeID OrgType ProgramStatus NoOfMbrshp
2 Basic Skills Program Active 642
2 Basic Skills Program Active 0 Mbrshp 591
There are these codes:
StatusID contains 1 and 3
ProgramStatusID contains Nulls, 1, and 3
Where 3 means Active