表达如果ELSE

时间:2012-03-12 12:18:34

标签: reporting-services

=IIf(Fields!TarifeTipiNo.Value = 265, "Saturday", IIf(Fields!TarifeTipiNo.Value = 266, "Monday", IIf(Fields!TarifeTipiNo.Value = 267, "Wednesday")))

我正在尝试将表达式写入我的报告[rdlc文件]中的单元格中,但我无法实现此目的。如果单元格等于265,则应显示星期六,或者如果等于266,则应显示“星期一”。有人可以帮帮我吗?

2 个答案:

答案 0 :(得分:14)

示例代码中的最后一个IIF指定了true部分。但是,未指定false部分。

=IIf(Fields!TarifeTipiNo.Value = 265, "Saturday", IIf(Fields!TarifeTipiNo.Value = 266, "Monday", IIf(Fields!TarifeTipiNo.Value = 267, "Wednesday", "????")))

OR

=Switch(Fields!TarifeTipiNo.Value = 265, "Saturday", Fields!TarifeTipiNo.Value = 266, "Monday", Fields!TarifeTipiNo.Value = 267, "Wednesday")

答案 1 :(得分:-2)

=First(Fields!Shipping_Name.Value, "DataSetForOrderEntry")+environment.NewLine+iif((First(Fields!Shipping_Company.Value, "DataSetForOrderEntry")=""),"",First(Fields!Shipping_Company.Value, "DataSetForOrderEntry")+environment.NewLine)+First(Fields!Shipping_Address1.Value, "DataSetForOrderEntry")+environment.NewLine+First(Fields!Shipping_Address2.Value, "DataSetForOrderEntry")+environment.NewLine+First(Fields!Shipping_City.Value, "DataSetForOrderEntry")+","+First(Fields!Shipping_State.Value, "DataSetForOrderEntry")+" "+First(Fields!Shipping_Zip.Value, "DataSetForOrderEntry")