• vitex2003 (1/30/2014)


    SELECT RangeType,StartDate,EndDate,Comment

    FROM dbo.TestTable

    WHERE convert(char(10),EndDate,102) >= cast('01 Oct 2013' as datetime)

    AND convert(char(10),StartDate,102) <= cast('01 Nov 2013' as datetime)

    You're code has the same performance and scalability problems as Jerry's code does. Please see my reply to him just above this post.

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