SQL Month from Number to Name


DECLARE

@monthInt int
SET @monthInt = 6

select DateName(MONTH,Dateadd(month, @monthInt - 1, 0)) as MonthName

–June

 

DECLARE @input INT = 3

SELECT DATENAME(MONTH,@input*28) AS CurrentMonth

--March

--http://www.sql-server-performance.com/2004/datetime-datatype/7/

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s