Thanks for all your help Arran,this should do it now. Ill let you know what the results are when I run some tests. Have you or anyone on your team ran these tests with the sample data we provided? Sent from my Android device