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)
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.
In the Expression: =Format(CDate(Fields! YourDateString. Value), "dddd,MMMM dd,yyyy")
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'));
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With