title: Grouping date periods (by number of days) but exclude the weekends?
body: <p>I have a table with start and end dates in. My goal is to have a table that has grouped these dates into how many days the period spans. I thought I had the solution with a simple SQL statement (MS SQL Server 2005) but I want to exclude weekends.</p>
  
  <pre><code>SELECT DATEDIFF(D, StartDate, EndDate)+1 AS Days,
   COUNT(ID) as Count 
  FROM myDateTable
  GROUP BY DATEDIFF(D, StartDate, EndDate)
  </code></pre>
  
  <p>This gives a record set of:</p>
  
  <pre><code>Days Count
  1    4
  2    2
  4    1
  7    2
  </code></pre>
  
  <p>Is this possible to exclude the weekends in the SQL statement and if not can it be done using ASP and a array perhaps?</p>