Please, don't go step by step.
You have 3 posts very similar and it seems to me that you're not giving us the entire problem.
If we're aware of the whole context, we can give you better ideas.
PS. I'm glad you liked my solution, a simple thanks would have been appreciated.