title: Calculate time difference (only working hours) in minutes between two dates
body: <p>I need to calculate the number of "active minutes" for an event within a database.  The start-time is well known.</p>
  
  <p>The complication is that these active minutes should only be counted during a working day - Monday-Friday 9am-6.30pm, excluding weekends and (known) list of holiday days</p>
  
  <p>The start or "current" time may be outside working hours, but still only the working hours are counted.</p>
  
  <p>This is SQL Server 2005, so T-SQL or a managed assembly could be used. </p>