2015-02-06 82 views
0

請參閱PIC enter image description hereSSRS IIF不工作

出於某種原因,我的表達是不工作多表達,我想不通爲什麼...

我想要做的是,如果檢查UseByDate它的空白設置時間爲空,並且如果選擇日期時間爲空白(時間字段),如果不是空白,也設置爲空白使用pickdatetime。然而,我的表情似乎沒有正常工作,出於某種原因?

=IIF(Fields!UseByDate.Value is nothing, nothing, IIF(Fields!PickedDateTime is nothing, nothing, FORMAT(System.TimeZone.CurrentTimeZone.ToLocalTime(Fields!PickedDateTime.Value), "HH:mm"))) 

我已檢查了pickdatetime值,並且該行絕對爲空。

enter image description here

+0

是否使用由它的屬性單元格中的時間格式選項用?解決這個問題的方法是,您可以根據您的值設置單元格的可見性。 – 2015-02-06 14:37:09

+0

我檢查了格式屬性,並且HH:mm被設置了,但是我刪除了這個並且它沒有修復它......我不希望整個列不可見,只是值。 – jhowe 2015-02-06 15:32:24

回答

1

更換Fields!PickedDateTimeFields!PickedDateTime.Value

+0

感謝您發現錯誤!不是我第一次這樣做... – jhowe 2015-02-10 17:19:59

1

我想表達的書寫方式不檢查沒有正確。嘗試:

=IIF(IsNothing(Fields!UseByDate.Value)=True, nothing, IIF(IsNothing(Fields!PickedDateTime)=True, nothing, FORMAT(System.TimeZone.CurrentTimeZone.ToLocalTime(Fields!PickedDateTime.Value), "HH:mm")))