Monday, 1 February 2010

SSRS Reports get Month name from Month Index or from date

This is one of the small tips which I want to tell my readers. When you work with SSRS reports, you may come across with the requirement like, you know the index of the month, but you want to print month name from it. So, if that is the situation for you, this is the right post for you. :)
MonthName(monthindex) 
You may get it from t-SQL as I mentioned in my previous post here.
But in SSRS reports the way you  need to approach is like this.
  1. Take a textbox to report body.
  2. Write the below syntax into it [As you know, it is the expression].
=MonthName(7)

In any case, you need to get it by date then you still use this below function.
=MonthName(Month(Fields!datefield.Value))

Hope this helps and please let me know, if you face any problems.

No comments:

Post a Comment