Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get current month name in SSRS?

I need current month name as default perameter name in my ssrs report. How can I get current month name using an ssrs expression?

For example "27-09-2012" would become "September"
and one more i need....

27-09-2012 to previous month name as well (August)

like image 351
Sandeep Pulikonda Avatar asked Sep 27 '12 13:09

Sandeep Pulikonda


People also ask

How to get month name from month Number in SSRS?

Try using =MonthName(Month(today())), tell us if it works. I edited the comment, to get the current date the function is today(), not now(). Second Question: "=MonthName(Month(DateAdd(DateInterval. Month, -1, Today())))", as Sammy said.

How to get month name and year in SSRS expression?

In the Expression: =Format(CDate(Fields! YourDateString. Value), "dddd,MMMM dd,yyyy")

How do I get the first date of the month in SSRS?

Getting First Day of the MonthSELECT m1 = DATEADD(DAY,1-DATEPART(DAY,@today),@today), m2 = CONVERT(date,CONCAT(YEAR(@today),RIGHT('0'+RTRIM(MONTH(@today)),2),'01'));


1 Answers

First question:

=MonthName(Month(Fields!datefield.Value))

Second question:

=MonthName(Month(DateAdd("m", -1, Today())))

I think the second question answer might be something like that, first converting the date to month then subtracting 1 from the month value and then converting it to month name.

Further reading:

  • SSRS Reports get Month name from Month Index or from date
  • Converting month number to month name in reporting services

OFF: I would change the date format you are using to 2012-09-27 as it works in every setting and should give you peace of mind when converting date formats.

like image 152
Turque Avatar answered Oct 18 '22 12:10

Turque