0

I have a report where I need to remove the time from a datetime column. I've found this expression to work but it changes all the null values to '1/1/0001'

=FormatDateTime(Fields!Temperature_Control_Inspection_Date.Value,DateFormat.ShortDate)

I have tried the below expression to look for nulls but it doesn't appear to work.

=IIF(Fields!Temperature_Control_Inspection_Date is nothing, nothing, FormatDateTime(Fields!Temperature_Control_Inspection_Date.Value,DateFormat.ShortDate))

How can I show just the Date from a DateTime column without also having all the nulls replaced by '1/1/0001'?

2
  • 1
    Try this one =IIf(IsNothing(Fields!Temperature_Control_Inspection_Date.Value), "", FormatDateTime(Fields!Temperature_Control_Inspection_Date.Value, DateFormat.ShortDate))
    – Kin Shah
    Dec 19, 2018 at 18:11
  • Converting my comment to answer. Please upvote/accept so that this does not show up as unanswered.
    – Kin Shah
    Dec 19, 2018 at 20:10

1 Answer 1

3

Below will work :

=IIf(IsNothing(Fields!Temperature_Control_Inspection_Date.Value), "", FormatDateTime(Fields!Temperature_Control_Inspection_Date.Value, DateFormat.ShortDate))

Above will have null dates as blank. Also, it will remove the time and just get you the date portion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.