3 Replies Latest reply: Jan 18, 2013 6:52 AM by Klaus Kring RSS

    Difference between timestamps greater than 2 minutes



      I have a database that records a date and timestamp against every transaction and essentially I want to flag up and sum (over a day, week etc) the amount of time between transactions when the difference between them is more than 2 minutes. See below example.


      12012-06-08 12:09:12
      22012-06-08 12:10:1200:01:00
      32012-06-08 12:14:1200:04:00
      42012-06-08 12:15:1200:01:00
      52012-06-08 12.26:1200:11:00
      62012-06-08 12:45:1200:19:00
      72012-06-08 12:46:1200:01:00


      In this example the total difference between timestamps is 37 minutes, however I don't care about when the difference is less than 2 minutes so don't require 3 of the transactions so the difference I want to see is 34 minutes. I'm thinking that using peek and an if statement in the script will work but any other suggestions?