In this article I am going to explain how to get number of days between two dates in Sql server.
In the previous article I have explained how to filter the record using Alphabetspager in asp.net, how to get comma separated values (data) from database andbind to checkboxlist in ASP.Net using C# and VB.net and how to Bind commaseparated values to listbox in asp.net.
DATEDIFF() function of Sql server returns the number of days between two dates.
declare @startDate datetime
declare @endDate datetime
set @startDate = '2016-03-15'
set @endDate = '2016-03-16'
select DATEDIFF(dd, @startDate, @endDate) as DayDiffrence
What do you think about this article?
If you found this article useful, please share and follow on Facebook, Twitter, Google Plus and other social media websites. To get free updates subscribe to newsletter. Please put your thoughts and feedback in comments section.