Selecting records and true or false value


    SSC Veteran

    Points: 270

    Hi All,

    Thanks in advanced for help given. I have the following table:


    I want to run a query to show two columns - process ID and a Boolean column. The Boolean column will be true if all the completeddatetime values have a datestamp for that process id. It will be false if any of the completeddatetime values have a null.

    So the output should say:

    5931  true

    5932  true

    5933  false

    5934  false

    I have tried this with iif statement and case statement but cant get it working, but am sure its quite simple!

    Thank you. sijcooke


  • Jeff Moden

    SSC Guru

    Points: 996445

    This is a duplicate post and it's actually incomplete.  Please, no replies here.  See the following post instead.  It's also been answered but don't let that stop you if you have a better way to solve this problem.

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

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply