title: SQL diff between rows
body: <p>I have a table with following structure</p>
  <pre><code>ID                  newSatus                    modifiedDate
  252123_001          Closed                      2020-10-07 20:14:57.477
  252123_001          Shipped                     2020-10-07 09:24:12.693
  252309_001          Closed                      2020-10-08 18:51:34.810
  252309_001          Shipped                     2020-10-07 09:22:33.537
  252404_001          Closed                      2020-10-07 12:25:10.270 
  252404_001          Shipped                     2020-10-07 09:29:02.363
  </code></pre>
  <p>Basically what i would like to do is have an access query that calculates the date difference for consecutive records between different newStatus but for the same ID.
  The expected result would be !!</p>
  <pre><code>ID                  diffHours               diffMinutes             diffSeconds
  252123_001          10h:50m:45s             650                     39045
  252309_001          1 day 9h:29m:01s        2009                    120541
  252404_001          2h:56m:08s              176                     10568
  </code></pre>
  <p>And finally calculates de median of time between these results.</p>