• Thanks,

    I needed to make some small changes because it was only part of a complete script, but I got it working.

    And also understand the query itself.

    Peter