xxxxxxxxxx
-- Month of today example:
SELECT MONTH(GETDATE()) AS Month;
xxxxxxxxxx
-- Using MONTH() and GETDATE() function to fetch current month
SELECT MONTH(getdate()) AS "Present Month";
-- Using DATEPART() function and GETDATE() function
SELECT DATEPART(MONTH, GETDATE()) as "Present Month Of the Year";
-- Getting the name of the current month
SELECT FORMAT(GETDATE(),'MMMM') AS Month;
xxxxxxxxxx
SELECT MONTH(CURRENT_TIMESTAMP);
SELECT DATEPART(month, CURRENT_TIMESTAMP);
Code language: SQL (Structured Query Language) (sql)
xxxxxxxxxx
SELECT EXTRACT(MONTH FROM '2018-08-01')
SELECT EXTRACT(MONTH FROM date)
xxxxxxxxxx
SELECT EXTRACT(MONTH FROM '2018-08-01')
SELECT EXTRACT(MONTH FROM date)
xxxxxxxxxx
SELECT EXTRACT(MONTH FROM '2018-08-01')
SELECT EXTRACT(MONTH FROM date)
xxxxxxxxxx
SELECT EXTRACT(MONTH FROM '2018-08-01')
SELECT EXTRACT(MONTH FROM date)
xxxxxxxxxx
SELECT EXTRACT(MONTH FROM '2018-08-01')
SELECT EXTRACT(MONTH FROM date)