• Ohhhh, be careful, folks. This looks like a trick question that I might write as an "ace breaker" on an example. If you read the original question, it says to return the "max" quantity sold... not the total. I believe Andy considered that but it all begs an explanation as to what is meant by "max" quanity sold if not taken at face value like Andy did ( and I believe he was correct in doing so).

    --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)