• paul.j.kemna (5/9/2013)


    So if I don't want to alter the contents of the SLHIH table directly, do I need to put the results of the query into a temp table and report off of it? Or is there a way to do this where i just get the results of the query to report from, without altering the contents of the SLHIH table?

    PK

    Ah, I see - then simply remove the UPDATE query. The one above it is the one you want. I'd strongly recommend that you play with all of them to see what they do.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden