• born2achieve (10/19/2013)


    Hi Jeff Thanks for your response and great article. But i have a concern that you are using custom year next to the declaration.

    SELECT @fromYear='1913-01-01', @toYear='1998-01-01'

    I don't want this to be hard coded. because the range applied on the formula may change some point of time, The current formula

    set @start = year(getdate()) - 15

    set @Upto = year(getdate()) - 100

    Here 15, 100 may get changed in near future. so i don't want this to be card coded. is there any way to avoid this to be hard coded.

    Look again... it's NOT my code. I quoted someone else's code.

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