title: How to create start & stop times when multiple start times are given?
body: <p>I'm trying to quantify active vs. idle times, and the first thing I need to do is to create distinct and discrete start and end times.  The issue is that the database is (I'm told this is a bug) creating multiple "start" times for the events. To make it even more complicated, a "report" can have multiple instances of being worked on, and each one should be logged as a discrete duration.  </p>
  
  <p>For instance, </p>
  
  <pre><code>WorkflowID ReportID User Action Timestamp      
  1           1         A  Start   1:00      
  2           1         A  Stop    1:03      
  3           1         B  Start   1:05      
  4           1         B  Start   1:06      
  5           1         B  Stop    1:08      
  6           1         B  Start   1:10      
  7           1         B  Start   1:11      
  8           1         B  Stop    1:14
  </code></pre>
  
  <p>I want to write a SQL query that would output the following:</p>
  
  <pre><code>User StartTime EndTime
  A     1:00      1:03
  B     1:05      1:08
  B     1:10      1:14
  </code></pre>
  
  <p>The issue I'm running into is that the number of start/stop events needs to be arbitrary (per ReportID per User).  In addition, the superfluous "start" times between the first "start" in the series and the following "stop" need to be removed to not mess it up.  </p>
  
  <p>Maybe I'm missing something, but this is tricky to me.  Any thoughts?  Thank you.</p>