title: TSQL working out total worked days
body: <p>I have to work out the total number of days worked from various different tables. I have a timesheet table and timesheet line table. The timesheetline table has the following fields:</p>
  
  <pre><code>Id; TimesheetId;    TimesheetLineCode;  WorkUnitId; EntryGroupId;   WorkerId;   
  Day1_Standard_RateId;   Day1_Standard_Hours;    
  Day2_Standard_RateId;   Day2_Standard_Hours ;
  Day3_Standard_RateId;   Day3_Standard_Hours ;
  Day4_Standard_RateId;   Day4_Standard_Hours ;
  Day5_Standard_RateId;   Day5_Standard_Hours ;
  Day6_Standard_RateId;   Day6_Standard_Hours ;
  Day7_Standard_RateId;   Day7_Standard_Hours ;
  ConcurrencyToken    ;
  </code></pre>
  
  <p>Now if a person has worked 3 hours in day 1 and worked 5 hours in day 5 then total worked days are 2 for that week. How do i work out total work days between two dates using these fields </p>