• Why do you want to write it differently?

    The way it is right now is one valid approach to tackle "catch-all-queries"[/url].

    It might be an option to move the "common query" into a view. This wouldn't help performance but it might help to reduce duplicate code.

    Another option would be dynamic sql.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]