SQL SERVER: Get total days between two dates
That is very simple to get the number of days between two dates,
This code give us what we are after,
PRINT DATEDIFF(DAY, '1/1/2011', '3/1/2011')
The code will give us the count of midnight boundary is crossed between the two dates in . Add one to this if including both dates in the count – or subtract one if don’t want to include either date.