# SolvedAnother one, check for 3 values if not is null then (1 Viewer)

#### kawai6rr

##### Registered User.
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
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
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.
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!

Replies
4
Views
129
Replies
13
Views
300
Replies
10
Views
237
Replies
7
Views
352
Replies
2
Views
113