• cs_source (1/3/2014)


    Thank you dwain.c, i'm working through the query now to under stand it (pretty complicated ๐Ÿ™‚

    hi Chris.m below is the sample data as well as my expected output (sorry i should have provided this earlier)

    ...

    Thanks! Yes that's great. It makes things so much easier.

    โ€œ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