Selecting records and true or false value

  • Hi All,

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

    1<b></b><i></i><u></u>

    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

     

  • 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.

    https://www.sqlservercentral.com/forums/topic/selecting-records-and-true-or-false-value

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

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

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