=IIF(Fields!Date.Value = "", "Some Text", Fields!Date.Value)
我在报告中有上面的语句,如果date value is NULL
,那么它将返回"Some Text",但是当date field has a value
得到#error
时,它不会返回date
我对这个表达式的理解是,如果满足条件,则返回"Some Text",否则返回Fields!Date.Value
为什么我会出错?
像这个一样
=IIF(Fields!Date.Value Is Nothing, "No Value", Fields!Date.Value)
IIF()
语句具有以下format
:
=IIF( Expression to evaluate,
what-to-do when the expression is true,
what-to-do when the expression is false )
Parameter1
:应该是Boolean
Expression
Paremeter2
:当Expression
为true
时,此值将返回Paremeter3
:当Expression
为false
时,此值将返回