• Mitch2007 (8/6/2009)


    It's a many to many relationship. Although there are duplicate Account numbers in table one and duplicate account numbers in table 2 there can only be one account number with a specific date in either of the two tables. The tables are joined using both Acct and Month using an inner join.

    Lynn thanks so much for your time on this, it is very much appreciated.

    If there is morth than a one year span in the table, joining by month (unless it's a month offset provided by DATEDIFF) would certainly be the source of some unexpected row counts.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)