Transact-SQL includes a bunch of functions that help us work with dates and times. One of the more common tasks when working with dates is to extract the different parts of the date. For example, sometimes we only want the year, or the month. Other times we might want the day of the week. Either way, there are plenty of ways to do this in SQL Server.
In particular, the following functions allow you to return the day, month, and year from a date in SQL Server.
These functions are explained below.