title: how to get the start and end dates of all weeks between two dates in SQL server?
body: <p>I need to get all week start and end dates(weeks) between two dates and then run a query returning the number of records inserted in each of those weeks.</p>
  
  <pre><code>declare @sDate datetime,
          @eDate datetime;
  
  select  @sDate = '2013-02-25',
          @eDate = '2013-03-25';
  
  --query to get all weeks between sDate and eDate
  
  --query to return number of items inserted in each of the weeks returned
  
  
  
  WEEK                  NoOfItems
  -----------------------------------------
  2013-02-25            5
  2013-03-4             2
  2013-03-11            7
  </code></pre>