**DATEDIFF (Transact-SQL) - SQL Server | Microsoft Docs**
https://docs.microsoft.com/en-us/sql/t-sql/functions/datediff-transact-sql

The int difference between the startdate and enddate, expressed in the boundary set by datepart. For example, SELECT DATEDIFF(day, '2036-03-01', '2036-02-28'); returns -2, hinting that 2036 must be a leap year. This case means that if we start at startdate '2036-03-01', and then count -2 days, we reach the enddateof '2036-02-28'. For a return value... dayofyear: dy, y quarter: qq, q month: mm, m year: yy, yyyy

The int** difference between** the startdate and enddate, expressed in the boundary set by datepart. For example, SELECT DATEDIFF(day, '2036-03-01', '2036-02-28'); returns -2, hinting that 2036 must be a leap year. This case means that if we start at startdate '2036-03-01', and then count -2 days, we reach the enddateof '2036-02-28'. For a return value...

**dayofyear:** dy, y

**quarter:** qq, q

**month:** mm, m

**year:** yy, yyyy

**DA:** 18 **PA:** 8 **MOZ Rank:** 95