Search code examples
reporting-services

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)


Solution

  • 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:

    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.