Eray Balkanli
Eray Balkanli

Reputation: 7960

Changing Date Format to month dd, yyyy from default in ssrs 2008

I have a date parameter in ssrs 2008 formatted by default, like YYYY-DD-MM (like 2015-03-31). What I want is to reflect this as Month dd, yyyy

I tried adding an expression like: =Format(Parameters!startDate.Value, "MMMM d, yyyy") -> however, It is writing "MMMM d, yyyy" as string to the textbox instead a date!

I tried to go to Number section of the expression, selected "Date" there and selected the format I wanted, didnt work. I did the same process by rightclicking the cell after then coming to the textbox properties, but again did not work.

I dont know what else to try. Any help would be appreciated.

Upvotes: 1

Views: 2511

Answers (1)

alejandro zuleta
alejandro zuleta

Reputation: 14108

I presumme your parameter is Text data type or somehow you cast the date value to a string.

You can either cast the value of your parameter to a date, something like this:

=FORMAT(CDATE(Parameters!startDate.Value),"MMMM d,yyyy")

Or you can go to Parameter Properties, in General, select Date as Data Type property.

Then just format using your expression:

=Format(Parameters!startDate.Value, "MMMM d, yyyy")

If you set the parameter as Date data type, a datepicker appears in the parameter pane at runtime for populating the parameter.

Both approaches produce:

march 31, 2015

Let me know if this helps.

Upvotes: 4

Related Questions