【发布时间】:2011-02-02 20:52:14
【问题描述】:
做一个表达式我得到一个错误,有人可以在这里告诉我正确的语法吗?
=IIf(Fields!t_cpcp.Value ="310", "Purchased Material & Raw Material", Nothing)
=IIf(Fields!t_cpcp.Value ="320", "Manufacturing Direct Labor", Nothing)
=IIf(Fields!t_cpcp.Value ="325", "Subcontract Cost", Nothing)
=IIf(Fields!t_cpcp.Value ="330", "Engineering Direct Labor", Nothing)
=IIf(Fields!t_cpcp.Value ="340", "Manufacturing Labor O/H", Nothing)
=IIf(Fields!t_cpcp.Value ="345", "Engineering Labor O/H", Nothing)
=IIf(Fields!t_cpcp.Value ="350", "Material O/H", Nothing)
=IIf(Fields!t_cpcp.Value ="355", "Labor O/H Surcharge", Nothing)
=IIf(Fields!t_cpcp.Value ="360", "Subcontract Material Burden", Nothing)
=IIf(Fields!t_cpcp.Value ="MFD", "Manufactured Items", Nothing)
【问题讨论】:
-
有机会告诉我们错误是什么吗?
-
是一个表达式还是多个表达式?,因为您显示的表达式不止一个
-
嗯,我有一列返回一个值,并且基于该值,我希望表达式列显示上面查询中的值之一。所以它是一个。
-
我得到的错误是 BC30205,预期语句结束。但我认为总体上是错误的,不确定。
-
您需要 switch 语句或嵌套 iif 语句。
标签: sql if-statement ssrs-2008 reporting-services