Solved Another one, check for 3 values if not is null then (1 Viewer)

kawai6rr

Registered User.
Local time
Today, 04:31
Joined
Aug 26, 2009
Messages
21
I was able to get the first one figured out with your help where I checked for 3 values and if they're null then put X

NoPatOcc: IIF (IsNull([P0_Count]), IIf(IsNull([P1_Count]), IIf(IsNull([P2_Count]), "X", " ")))

This says that no occurrence was detected.

Now I need to check for an occurrence in any of those 3 fields so I need to use OR but can't seem to get this to work. I get the error "the expression you entered is missing a closing parenthesis, bracket, or vertical bar".

YesPatOcc:IIf(Not IsNull([P0_Count]) Or IIf(Not IsNull([P1_Count]) Or IIf(Not IsNull([P1_Count]), "X", "")

When using this code I get the error "wrong number of arguments".

YesPatOcc:IIf(Not IsNull([P0_Count]) Or IIf(Not IsNull([P1_Count]) Or IIf(Not IsNull([P2_Count]), "X", "")))

Any help is appreciated, thanks.
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:31
Joined
Sep 21, 2011
Messages
14,234
Can't you just swap the result?

Code:
YesPatOcc: IIF (IsNull([P0_Count]), IIf(IsNull([P1_Count]), IIf(IsNull([P2_Count]), " ", "X")))
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:31
Joined
Oct 29, 2018
Messages
21,454
Hi. You could also try:
Code:
IIf(Not IsNull([P0_Count]  Or Not IsNull([P1_Count]) Or Not IsNull([P2_Count]), "X", "")
 

kawai6rr

Registered User.
Local time
Today, 04:31
Joined
Aug 26, 2009
Messages
21
Thanks again for the replies, once I got the error to go away it started working, I was missing a parenthesis.

YesPatOcc:IIf(Not IsNull([P0_Count]), "X", IIf(Not IsNull([P1_Count]), "X", IIf(Not IsNull([P2_Count]), "X", "")))

Thanks again!
 

Users who are viewing this thread

Top Bottom