In this tutorial, we will learn that how to get Year, Month, Quarter, Weeks, Days, Day of Year and Day of the month by using DatePart()
function in SQL Server.
As you know that In SQL Server, the T-SQL DATEPART() function returns an integer that represents the specified datepart of the specified date.