Updated on Kisan Patel
This tutorial will show you how to return day, month, and year in the SQL Server database?
To return day, month and year of the date we can use DAY
, MONTH
and YEAR
function by passing the current date.
Similarly, to get day, month and year of other date simply pass other date as parameter to these functions.
SELECT
DAY(GETDATE()) as Day,
MONTH(GETDATE()) as Month,
YEAR(GETDATE()) As Year