user5021612
user5021612

Reputation:

How to retrieve current month in SSRS expression

I want to get current month as default value of a parameter. I've come up with (which does not work):

=Month(Now())

Upvotes: 2

Views: 12949

Answers (2)

N. Haut
N. Haut

Reputation: 159

In order to get the month as an integer you can do what you had listed originally

=MONTH(NOW())

You can convert that from an integer to the actual month name by using

=MONTHNAME(MONTH(NOW()))

Upvotes: 0

Pedro Chiiip
Pedro Chiiip

Reputation: 188

If you want to get the month as an int that goes from 1 to 12, you can use this

SELECT MONTH(GETDATE())

This answer was based on the official documentation that you can see in here - http://technet.microsoft.com/en-us/library/ms187813.aspx

Edit

For reporting services specifically, you can use

MonthName(NOW())

This will return a month name and i believe is the function you're looking for.

Or, in case you want the month as an integer, try using

Month(TODAY())

Upvotes: 4

Related Questions