1 Reply Latest reply on Dec 25, 2012 8:42 PM by Joshua Milligan

    Calculate difference between two rows

    Sam Jess


      I have a unique problem. I have a log table which looks like this ::

      Action | Date | User | OrderID

      StartOrder 12/1/2012 SomeOne 12221

      ProcessOrder 12/2/2012 SomeOne 12221

      StartOrder 12/4/2012 AnotherOne 1251

      ProcessOrder 12/6/2012 AnotherOne 1251


      Now i would like to calculate the processing time per user. This is simply ProcessOrder date - StartOrder date. What is the best way to approach this ? The OrderID is unique per action.


      Also since this is a log table, sometimes the actions are duplicated. How can i eliminate and only use the most recent one ?

      Thank you !