Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIF statement not behaving as expected

=IIF(Fields!Date.Value = "", "Some Text", Fields!Date.Value)

I have the above statement in a report, and if the date value is NULL, then this will return "Some Text", however instead of returning the date when the date field has a value i get #error

My understanding of the expression is that if the condition is met return "Some Text" otherwise return Fields!Date.Value

Why do I get an error?

like image 576
R_Avery_17 Avatar asked Jan 01 '26 14:01

R_Avery_17


1 Answers

Do that like this

=IIF(Fields!Date.Value Is Nothing, "No Value", Fields!Date.Value)

The IIF() statement has the following format:

=IIF( Expression to evaluate,
         what-to-do when the expression is true,
         what-to-do when the expression is false )
  • Parameter1: It should be a Boolean Expression.
  • Paremeter2: This value will return when Expression is true.
  • Paremeter3: This value will return when Expression is false.
like image 148
ArunPratap Avatar answered Jan 03 '26 02:01

ArunPratap



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!