• It's a bit difficult to believe that you would ever have a NULL StartDate with a valid EndDate.  Normally, it's the other way around.  But, no worries...

    For NULL StartDates, I would treat them as if they were '01/01/1900'  and I would treat NULL EndDates as if they were '12/31'9999'

    SELECT * FROM xyz

    WHERE ISNULL(StartDate,'01/01/1900') < ISNULL(EndDate,'12/31/9999')

    Do be advised that this method may not use an index on either date...

     

    --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)
    Intro to Tally Tables and Functions