How count Difference Between Two date Using DatedIff
Microsoft Net Framework

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;

Share This with your friend by choosing any social account


Upcoming Articles
You may also read following recent Post
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM