T-SQL 101: 69 Extracting date components in SQL Server T-SQL with DAY, MONTH, and YEAR
When you’re writing T-SQL code, it’s really common to need to extract components of a date, and the most common need is for year, month, and day. So T-SQL has separate functions just for that.
You can see the output from this query here:
The YEAR(), MONTH(), and DAY() functions take a date (or datetime, datetime2, smalldatetime) as input and return an integer for the year, month, or day.
2020-05-11