2 Replies Latest reply: Jan 30, 2013 7:58 AM by Markus König RSS

    if statement with timestamps

    Markus König

      I have the following data:

       

      TIME_STAMPAtribute A
      08.05.2012 10:12:111
      08.05.2012 11:01:301
      08.05.2012 11:47:162
      08.05.2012 16:02:061
      08.05.2012 16:32:111
      08.05.2012 16:43:541
      08.05.2012 17:42:542
      08.05.2012 17:43:242
      08.05.2012 18:51:471
      08.05.2012 19:24:431
      08.05.2012 19:54:443
      08.05.2012 09:14:004
      08.05.2012 09:38:001
      08.05.2012 10:09:002
      08.05.2012 11:00:572
      08.05.2012 12:00:021
      08.05.2012 13:01:091
      08.05.2012 13:32:441
      08.05.2012 14:00:413
      08.05.2012 14:35:052

       

      My goal is to get the sum over the next 10 minute of the timestamp.

      Example: For 08.05.2012 17:42:54 the result should be 4.

       

      My idea is:

      sum(if(TIME_STAMP<=TIME_STAMP+7minute,Atribute A)) as mySum

       

      But I have no idea for the code TIME_STAMP+7. Any ideas?