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'


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'?

  • 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 '18 at 18:11
  • Converting my comment to answer. Please upvote/accept so that this does not show up as unanswered. – Kin Shah Dec 19 '18 at 20:10

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, privacy policy and cookie policy

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