I have datetime type from DB table.
In SSRS report, I'm getting datetime format mm/dd/yyyy. I want to change it to dd/mm/yyyy.
I have added expression like:
=FormatDateTime(Format(Fields!TransactionDate.Value,"dd/MM/yyyy"),DateFormat.ShortDate)
But, this is showing #Error in the report. How to correct this?
The first approach to Format Data and Time in SSRS Report Once we click on the Text Box Properties.. option, a new Text Box Properties window will be opened. Please select the Number tab and then date category. Our report preview is displaying the Hire date in the same format.
First go to your control panel , select Date , time and Number Format . Now select English(United Kingdom) from the drop down list. Make sure the shor date field is equal to 'dd/mm/yyyy'. Press Apply.
The CDate function converts the value to a date. The Now function returns a date value containing the current date and time according to your system. DateDiff returns a Long value specifying the number of time intervals between two Date values.
If the field in the data set is datetime, then the expression to use is
=FORMAT(Fields!Dataset_Field_Name_Here.Value,"dd/MM/yyyy")
From looking at the expression, the 'DateFormat.ShortDate' is using the language set for the report? Goto report -> properties -> Localization -> Language. I set it to en-GB so that it will display dates in the format l require. However this value if l remember correctly can be overridden by the language settings on the client computer displaying the report.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With