2015-12-18 46 views
0

我期待在使用4個表達式3爲等於和1爲不平等,但不計算不等於使用不等於表達

IM。

=sum(iif(Fields!NEW_SUPPLIER.Value = "Eon", 1,0) 
And (Fields!WeekDay.Value = "Monday") 
And (Fields!UTILITY.Value = "Elec") 
And (Fields!OLD_SUPPLIER.Value <> "Eon")) 

請有人指出我在正確的方向。

回答

1

你需要確保所有的檢查都在IIf表達的第一個參數:

=sum 
(
    iif 
    (
     Fields!NEW_SUPPLIER.Value = "Eon" 
      And Fields!WeekDay.Value = "Monday" 
      And Fields!UTILITY.Value = "Elec" 
      And Fields!OLD_SUPPLIER.Value <> "Eon" 
     ,1 
     ,0 
    ) 
)