Can someone please help with this thread? I was thinking that the answer should be in the form of SQL but the op wants a .NET solution.

I was trying to give the other person a suggestion but he/she wants something else so I thought I would try to pass off the question to the real gurus of this site.