• todd.ayers (5/22/2013)


    Well,

    I have finally had a chance to test this and I keep getting an error message saying:

    Msg 102, Level 15, State 1, Line 53

    Incorrect syntax near ')'.

    I don't see anything wrong with the code though

    What version of SQL Server are you connecting to, Todd?

    “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