Thank you sir, for your effort in helping me. Before I saw your file, I had managed to get the result after following the suggestion posted in my other thread. I found it easier as it didn't have your TOP expression and multiple subqueries. However, I intend to compact my own effort as it is...