title: Query to total monthly hours for events spanning month borders
body: <p>I have a series of events that are unique and may continue for an arbitrary time.  I need to calculate how may hours the events contribute to a monthly totals, given that the event may commence before a specific month (in which case it will contribute to the previous month as well as the current month) and finish after a specific month.</p>
  
  <p>The data looks something like:</p>
  
  <pre><code>Event | StartDate | EndDate   |
  -------------------------------
  | 1   | 10/01/2015| 11/01/2015|
  | 2   | 20/12/2014| 9/01/2015 |
  | 3   | 25/01/2015| 14/02/2015|
  </code></pre>
  
  <p>Ultimately, I am try to generate a list grouped by month and year that totals the "Event Hours" for each month (not each event - events within the month are summed).</p>
  
  <p>To be honest, I am not even sure where to start with this.</p>