Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Highlighted

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

New Contributor

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

2 REPLIES 2

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

Super Collaborator

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 :)

Highlighted

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

New Contributor
Don't have an account?
Coming from Hortonworks? Activate your account here