IIF语句未按预期运行



=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:应该是BooleanExpression
  • Paremeter2:当Expressiontrue时,此值将返回
  • Paremeter3:当Expressionfalse时,此值将返回

相关内容

  • 没有找到相关文章

最新更新