• dwain.c (5/22/2013)


    ...

    That is a brilliant solution Chris!

    And here I thought when I pulled up this thread I could make a shameless plug for my random numbers article (in my signature).

    Thanks by the way for the nice plug in your signature for my rCTEs article.

    Thanks Dwain! I get a warm fuzzy feeling inside when I write a query which you can tell at a glance what it's supposed to 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