Glad it worked out for you, though I must go out to say that MS SQL sucks if it can't even allow a alias to be used with the group-by clause which is so common a thing with present databases. So much for the Enterprise level database... ;-)
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 720
Failure as a human
Offline 8,872 posts
since Jun 2006