• Dear mister.magoo,

    that's impressing! your solution is absolutly useful for me, thanks a lot!

    I tried something like this:

    1. "unpivot" start- and endtime into dt-, and type column

    2. compare current and previous dt timestamps for each type and remember only the timestamp with a higher prio than previous

    3. for each acct: if sum(dt) from start events set - sum(dt) from end events set = 0 => complete interval

    4. order the result and "pivot" dt to starttime = curr.dt and endtime = next.dt

    I hope that I did no logic mistake here...I'm still busy with the sql and if I have success I will post it here..

    again, thank you very much!

    Ralf