Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

converting date from mm/dd/yyyy to dd/mm/yyyy in SSRS

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?

like image 267
bapi Avatar asked Jun 20 '14 09:06

bapi


People also ask

How do I change the date format in SSRS?

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.

How do I change the date format in report Builder?

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.

What is CDate in SSRS?

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.


1 Answers

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.

Report Properties showing Localization -> Language

like image 119
SQLBobScot Avatar answered Sep 22 '22 06:09

SQLBobScot