Answers for "get month of date sql"

SQL
0

get month of date sql

-- 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;
Posted by: Guest on February-28-2022

Code answers related to "SQL"

Browse Popular Code Answers by Language