• dthmtlgod (10/15/2012)


    I am attempting to pull only open tickets from my table. Thing is we have duplicate records with different status code in our data

    TICKET STATUS

    9543 1

    9543 5

    9543 5

    9544 1

    9546 1

    9547 1

    9547 5

    I only want the records with a 1 and not a 5 status, so in the above sample, I should only return 9544 and 9546.

    Any suggestions are much appreciated.

    The question that begs to be answered here is.... in real life, will there be any tickets with a status other than 1 and 5 and what do you want to do if that's true?

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