Alias Varghese
Alias Varghese

Reputation: 2172

Showing day name and month name in ssrs

I am having a date example 4/29/2015 . I need to change the format of date like "Wednesday,april 29,2015. How to achieve this using SSRS.?

Upvotes: 11

Views: 28559

Answers (2)

Mahmoud Gamal
Mahmoud Gamal

Reputation: 79929

Assuming that your date field is of data type date or datetime (otherwise you will need a cast in your sql query), this is how you can do it:

  • Right click the textbox where your datetime is displayed and choose textbox properties:

enter image description here

  • From the left panel choose Number, then date and choose the desired format:

enter image description here

  • Then you should see the date displayed as:

enter image description here

Upvotes: 12

Sébastien Sevrin
Sébastien Sevrin

Reputation: 5405

Your expected format (Wednesday,april 29,2015) is not standard, so you will need the following custom format:

"dddd,MMMM dd,yyyy"

So the date 4/29/2015 will output Wednesday,April 29,2015 which is closer to what you need than the D standard format which will output Wednesday, April 29, 2015.

Now that you have the right format, you need to place it on the report.

There are 2 options:

I am assuming you have a datetime field called YourDate or a string field called YourDateString.

  1. In the Expression:

    • =Format(CDate(Fields!YourDateString.Value), "dddd,MMMM dd,yyyy")
    • =Format(Fields!YourDate.Value, "dddd,MMMM dd,yyyy")
  2. In the report item properties

    • Expression:
      =CDate(Fields!YourDateString.Value) or =Fields!YourDate.Value
    • Text Box Properties => Number => Custom => Custom format:
      dddd,MMMM dd,yyyy

Upvotes: 8

Related Questions