Skip Ribbon Commands
Skip to main content

Erin Glenn's Blog

:

Erin Glenn's Blog > Posts > How to Get Month Name When You Only Have Month Number (SQL View)
May 05
How to Get Month Name When You Only Have Month Number (SQL View)

I on​ly have the month's number and not a full date.  I need to use both the month's number and the name in a SSRS parameter.  (I sort by the number and display the name.  I then filter my dataset on the month number.)

Here's the trick!

SELECT distinct [MonthofYear], DateName(mm,DATEADD(mm,MonthofYear - 1,0)) as MonthName
FROM V_MyView
Order By MonthofYear

Comments

There are no comments for this post.