Detecting NULL dates and showing empty string in SSRS

后端 未结 2 1877
[愿得一人]
[愿得一人] 2021-02-12 15:38

I\'m trying to format some cells in a Reporting Services report that will contain DateTime? values - or not.

If the underlying data has a NULL

2条回答
  •  北海茫月
    2021-02-12 15:59

    I just tested the following expression and it replaced the null date with an empty string:

    =IIF(Fields!DatumBSE.Value is nothing, nothing, FormatDateTime(Fields!DatumBSE.Value, 2))
    

    The other suggestion that I would make is that you could format the date to the correct format in the report dataset by placing a CASE expression around the date value.

提交回复
热议问题