web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Formatting Date fields in SSRS reports

(0) ShareShare
ReportReport
Posted on by 91

Hello. Any date field from Dynamics 365 that I bring in to an SSRS report with a FetchXML data set, is not recognized as a date.  I can display the data without any issue, but I can't format the field to some how convert the string into a date field. I suspect it has to do with the time value in the field.

I have tried the formula: 
=Format(CDate(Left(Fields!createdon.Value,10)))

This works with many of the values, but unfortunatley, not all of the values (perhaps because they don't have a time in the date field?)

timestamp.PNG

Below is an example of the above column, and the data without any formatting.  I can't see a reason for why the formula would work on some of the values, but not the others.  This is the "Created On" field that is in all entities.

 date-with-both.PNG

I would appreciate suggestions for how to solve this.  Thank you!

I have the same question (0)
  • unicorn_tech Profile Picture
    91 on at
    RE: Formatting Date fields in SSRS reports

    Interesting. Though I'm not using an IF function here. My goal is just to sort by date, which I can't do if the date can't be formatted as such.

  • Suggested answer
    Nya Profile Picture
    29,060 on at
    RE: Formatting Date fields in SSRS reports

    Hi,

    Some values in an expression can evaluate to null or undefined at report processing time. This can create run-time errors that result in #Error displaying in the text box instead of the evaluated expression. The IIF function is particularly sensitive to this behavior because, unlike an If-Then-Else statement, each part of the IIF statement is evaluated (including function calls) before being passed to the routine that tests for true or false. The statement =IIF(Fields!Sales.Value is NOTHING, 0, Fields!Sales.Value) generates #Error in the rendered report if Fields!Sales.Value is NOTHING.

    Please refer to the following section which may help you.

    Suppressing Null or Zero Values at Run Time

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
DAnny3211 Profile Picture

DAnny3211 359

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 137 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 77 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans