Deepak Singla
Deepak Singla

Reputation: 161

Ignoring blanks in IFF condition in SSRS expressions

iif(Fields!ABC.Value<=Fields!XYZ.Value and Fields!XYZ.Value<=Fields!PQR ,"Y","N")

Here ABC,XYZ and PQR are date fields.

The problem is if any ABC/XYZ/PQR is empty then it always returns N but i want if any of these are blank then the condition ignores the blank and check the next condition

eg. if ABC is blank then Fields!ABC.Value<=Fields!XYZ.Value is ignored and the condition after and is checked and return the value according to that.

Please suggest any solution. Thanks in advance.

Upvotes: 0

Views: 667

Answers (1)

KrazzyNefarious
KrazzyNefarious

Reputation: 3230

since you are checking for the condition only when another condition is true, you will need nested iif. Again since you want to skip the condition if any of the dates are null, you would need to check for each date before you put them into iif block.

You can try something like this

=iif(
iif(isnothing(Fields!ABC.Value) or isnothing(Fields!XYZ.Value),true,Fields!ABC.Value<=Fields!XYZ.Value) and 
iif(isnothing(Fields!XYZ.Value) or isnothing(Fields!PQR .Value),true,Fields!XYZ.Value<=Fields!PQR.Value) ,"Y","N")

Upvotes: 1

Related Questions