Someone asked this question: I have months stored in SQL Server as 1,2,3,4,…12. I would like to display them as January,February etc. Is there a function in SQL Server like MonthName(1) = January? I am trying to avoid a CASE statement, if possible.
But the answers that I saw weren’t doing it for me.
So here is my own answer:
SELECT InvoiceDate, DATENAME(MONTH, InvoiceDate) As InvoiceMonth
FROM Online_Sales
*InvoiceDate is a name of a column.
Hope this helps whomever that will be needing it.
Chukwudi Chukwuma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.