Answers for "get day and month from date in sql"

SQL
-1

get day in sql

SELECT DATEPART(m, GETDATE()) as theMonth  -- returns 11
SELECT DATEPART(d, GETDATE()) as theDay   -- returns 20
SELECT DATEPART(yy, GETDATE()) as theYear   -- returns 2013
Posted by: Guest on September-04-2020
0

sql get month and year from date

DECLARE @date date = '04-18-2020' --date for act;
SELECT YEAR(date), MONTH(date)    --, DAY(date) add if u want day
Posted by: Guest on January-30-2022

Code answers related to "get day and month from date in sql"

Code answers related to "SQL"

Browse Popular Code Answers by Language