Thanks very much for the very useful lines you added. This is exactly what I was looking for, but did not know how to formulate. This is very clean and very efficient for my needs.
Also, thanks to all who reaponded, I appreciate your answers as well.