tags:

views:

92

answers:

1

How do you calculate the number of weeks between two dates?

Declare @StartDate as DateTime = "01 Jan 2009"; Declare @EndDate as DateTime = "01 June 2009";

@StartDate and @EndDate

+1  A: 

Use the Datediff function. datediff(ww,@startdate,@enddate)

the ww tells the function what units you require the difference to be counted in.

http://msdn.microsoft.com/en-us/library/ms189794.aspx

Rob