Description:-
In this article I am going to
explain how to get number of days between two dates in Sql server.
DATEDIFF() function of Sql server returns the number of days
between two dates.
Syntax:-
Select DATEDIFF(day,startDate,endDate)
Example:-
declare @startDate datetime
declare @endDate datetime
set @startDate = '2016-03-15'
set @endDate = '2016-03-16'
select DATEDIFF(dd,
@startDate, @endDate) as DayDiffrence
1 comments:
commentsNice one
ReplyThanks for comments.....