Steph
Steph

Reputation: 51

iif statement do nothing

I am trying to return nothing for a false statement. Is there a way to do this?

iif(a=1, "Yes", null) <--- this obviously didn't work, but is there anything else that returns nothing if it evaluates a statement as false?

Upvotes: 5

Views: 3136

Answers (1)

Alan Schofield
Alan Schofield

Reputation: 21683

If this is in an SSRS expression then you can use the following

=IIF(Fields!myField.Value = 1, "Yes", nothing)

nothing in SSRS expressions is similar to NULL

For example you can set a textbox background color to nothing which is the same as selecting 'no color' on the property drop down.

Upvotes: 6

Related Questions