11

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?

bapi
  • 1,903
  • 10
  • 34
  • 59

4 Answers4

24

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

SQLBobScot
  • 694
  • 5
  • 20
11

Got solution:

 =CDate(Fields!TransactionDate.Value).ToString("dd/MM/yyyy")
bapi
  • 1,903
  • 10
  • 34
  • 59
9

Go to textbox properties: Before changing the Custom to dd/MM/yyyy (as shown), select option Date and select format MM/dd/yyyy i.e. 01/31/2000 in RS 2008. Hope it helps.

enter image description here

p2k
  • 2,126
  • 4
  • 23
  • 39
0

Format(Cdate(Fields!TransactionDate.Value),"dd/MM/yyyy")