The DATEDIFF() function returns the difference between two date values, based on the interval specified.
Queries & Examples
1.Diiference Between Years
SELECT DATEDIFF(year, '2011/08/25','2017/08/25') AS Years;
It give use Result Of Difference of year
-----------------------------------------------------
2.Diiference Between Month
SELECT DATEDIFF(MONTH, '2011/08/25','2017/08/25') AS Months;
----------------------------------------------------
3.Diiference Between Weeks
SELECT DATEDIFF(WEEK, '2011/08/25','2017/08/25') AS Weeks;
----------------------------------------------------
4.Diiference Between Days
SELECT DATEDIFF(DAY, '2011/08/25','2017/08/25') AS Days;
----------------------------------------------------
5.Diiference Between Minutes
SELECT DATEDIFF(MINUTE, '2011/08/25','2017/08/25') AS Minutes;