• Cheers. I actually ended up doing it in SQL using the RANK( ) function which worked quite well.

    However the above looks a good solution and I will end up using it at some stage.

    Cheers mate.