This article is half-done without your Comment! *** Please share your thoughts via Comment ***
Check the below input data and expected output and get the name of Month Name.
Expected Output for Month 1:
1 2 3 |
Month_Name -------------- January |
Check different Solutions:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
SELECT DATENAME(month, '2018-01-01') AS Month_Name SELECT DATENAME(month , DateAdd( month , 1 , 0 ) - 1 ) AS Month_Name SELECT DATENAME(month, '2018-01-01') AS Month_Name SELECT DATENAME(month , DateAdd( month , 1 , -1 )) AS Month_Name SELECT DATENAME(month, STR(YEAR(GETDATE()), 4) + REPLACE(STR(1, 2), ' ', '0') + '01') AS Month_Name SELECT CONVERT(CHAR(3), DATENAME(MONTH, '2018-01-01')) AS Month_Name SELECT DATENAME(M, DateAdd(M, 1, -1)) AS Month_Name |
Please try the different solution for this puzzle and share it via comment...