IIF声明表现不尽如人意

问题描述 投票:2回答:1

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

我在报告中有上述声明,如果date value is NULL,那么这将返回“Some Text”,但是当date我得到date field has a value而不是返回#error

我对表达式的理解是,如果满足条件,则返回“Some Text”否则返回Fields!Date.Value

为什么我会收到错误?

c# reporting-services ssrs-2012 rdlc
1个回答
2
投票

这样做

=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:当Expressiontrue时,此值将返回。
  • Paremeter3:当Expressionfalse时,此值将返回。
© www.soinside.com 2019 - 2024. All rights reserved.