• Gillian_Pappas2002 (12/16/2013)


    Hi There.

    Yes, there can be other statuses, but I am just looking for each customer order that may have 1 to n customer order lines, and that the line statuses ALL must be = C. I think I got it to work just now by using aliases. It tests correctly now. I never did get that cte code to work right.

    Thanks.

    Gillian

    So we're not actually looking to disqualify a customer if they have an "O" status... just to replay what you said above, we're actually looking for only those customers that have all "C" status. ANY OTHER status will act as a disqualifier for the customer, not just those with an "O" status, correct?

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