To fetch the name of the month (ex: January) , use below sample SQL as reference
Query:
select
to_char(sysdate,'dd-mon-yyyy', 'nls_date_language = english') curr_date
from dual
Result:
CURR_DATE
30-jan-2019
Query:
select
to_char(sysdate,'dd-Mon-yyyy', 'nls_date_language = english') curr_date
from dual
Result:
CURR_DATE
30-Jan-2019
Query:
select
to_char(sysdate,'dd-MON-yyyy', 'nls_date_language = english') curr_date
from dual
Result:
CURR_DATE
30-JAN-2019
Query:
select
to_char(sysdate,'dd-Month-yyyy', 'nls_date_language = english') curr_date
from dual
Result:
CURR_DATE
30-January-2019
Query:
select
to_char(sysdate,'dd-MONTH-yyyy', 'nls_date_language = english') curr_date
from dual
Result:
CURR_DATE
30-JANUARY-2019
In case you only need month use below
Query:
select
to_char(sysdate,'Month', 'nls_date_language = english') curr_month
from dual
Result:
CURR_MONTH
January
I hope this explains how to fetch the month name in words. If you have any questions, please post it in the comments section
I hope this explains how to fetch the month name in words. If you have any questions, please post it in the comments section
Can you tell how to fetch the current day?
ReplyDeletePlease refer to this blog
Deletehttps://elearningever.blogspot.com/2019/02/how-to-fetch-name-of-month-ex-january.html
Fetch the Month name in words in SQL
ReplyDelete