Reply
New Contributor
Posts: 1
Registered: ‎09-11-2017

Do we have an inbuilt function to get the name of the month from date directly?

Do we have an inbuilt function to get the name of the month from date directly? We know we have a function month(date) where we can get the month number and then we can use a case function to get the name of the month but I am looking out for a direct funtion.

 

This can be done hands down in SQL Server like below.

 

SELECT DATENAME(month, '12:10:30.123') Month_name, DATENAME(weekday, '12:10:30.123') day_name

 

Month_name  day_name
January          Monday

Highlighted
Posts: 174
Topics: 8
Kudos: 19
Solutions: 19
Registered: ‎07-16-2015

Re: Do we have an inbuilt function to get the name of the month from date directly?

I don't know if such a function exist.

But if not you can create your own UDF for doing this quickly.

 

I do agree that you should not use a "CASE" syntax in a query. Too complex :)

Announcements