=IIF(Fields!Date.Value = "", "Some Text", Fields!Date.Value)
我在报告中有上述语句,如果 date 值为 NULL
,那么这将返回“Some Text”,而不是返回 date
date 字段有一个值
我得到 #error
我对表达式的理解是,如果满足条件返回“Some Text”否则返回Fields!Date.Value
为什么会出现错误?
最佳答案
像这样做
=IIF(Fields!Date.Value Is Nothing, "No Value", Fields!Date.Value)
IIF()
语句具有以下格式
:
=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
时,该值将返回。
关于c# - IIF 声明未按预期运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53518729/