title: Calculatng the time difference between two times (using the next specific ID)
body: <p>Here is an example of the table:</p>
  
  <pre><code>ProductID    TransID    TransSubID    TimeID (HH:MM:SS)
  111          58           2           10:00:00 
  251          185         10           11:00:00
  111          80           0           12:00:00
  538          117          1           13:00:00
  111          80           0           14:00:00
  </code></pre>
  
  <p>I need a query to return the elapsed time for <code>ProductID 111</code> between <code>TransID 58</code> , <code>TransSubID 2</code> and the next record for <code>ProductID 111</code> ,   <code>TransID 80</code>  ,  <code>TransSubID 0</code>. The correct result would be <code>2 hours</code>. <code>4 hours</code> would be incorrect.</p>