0 Replies Latest reply: Sep 26, 2011 5:16 AM by Håkan Johansson RSS

    Excluding breaks

    Håkan Johansson

      Hi,

      I have a table that contains EventId, Start of the event and End of the event.

      EventId               EventStart        EventStop

      A                         1                         4

      B                         4                         5

      C                         2                         6

      D                         4                         7

      E                         6                         8
      …and so on.

       

      I also have a table containing start times and stop times of breaks

      BreakEvent       Time

      BreakStart           3

      BreakStop           5

      BreakStart           9

      BreakStop           12
      …and so on

       

      I would now like to generate a table that reduces the Events so that no event “occurs” during a break

      EventId               EventStart        EventStop

      A                         1                         3

      C                         2                         3

      C                         5                         6

      D                         5                         7

      E                         6                         8
      …and so on

       

      Event B should not show up in this new table since it starts and ends within a break

      The EventStart , EventStop and Time are in reality timestamps

       

      Any Ideas how this could be done? I have tried with interval match but the scripting gets quite ugly and I have not yet been able to get it right.