Here's some good reading for you folks who may be new to dynamic sql:
http://www.sommarskog.se/dynamic_sql.html
John Rowan
======================================================
======================================================
Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden