Ok, Sergiy wins. Lightning fast and easily maintainable if required.
I had to look at that function line a few times ... SET @Count = ReviewNo = CASE ...
to figure out exactly what he did though. And once again I've never considered doing that.
I'm learning just how much I don't know I guess!
Thank you Sergiy