Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
19.2k views
in SQL Server Reporting Services by 11 12 19
edited by

In SSRS Report Builder, I built a multiple OR condition in the IIF expression to check if a specific parameter equal to a specific value OR EMPTY 

=IIF(Parameters!Name.Value="All" OR Parameters!Name.Value="Select Value" OR Parameters!Name.Value="",True,False)

Although the IIF expression syntax is correct, the result is not displayed as expected! 

Can you please help How to use Multiple AND OR in IIF condition in SSRS correctly?

Thanks for any kind of help!


1 Answer

1 like 0 dislike
by 82 149 313
selected by
 
Best answer

In SSRS, to can use Multiple AND or Multiple OR in IIF expression, you just need to enclose each condition with parenthesis () as the following:

SSRS: Multiple OR in IIF expression

To use Multiple OR in IIF expression in SSRS, you should use the below syntax

=IIF((Condition1) OR
     (Condition2) OR
     (Condition3), True,False)

In your case, the Multiple OR condition in IIF expression should be

=IIF((Parameters!Name.Value="All") OR 
     (Parameters!Name.Value="Select Value") OR 
     (Parameters!Name.Value=""),True,False)

SSRS: Multiple AND in IIF expression

To use Multiple AND in IIF expression in SSRS, you should use the below syntax

=IIF((Condition1) AND
     (Condition2) AND
     (Condition3), True,False)

Ex: to use Multiple AND condition in IIF expression in SSRS

=IIF((Parameters!Name.Value="All") AND
     (Parameters!Name.Value="Select Value") AND
     (Parameters!Name.Value=""),True,False)
If you don’t ask, the answer is always NO!
...