• Sachin 80451 (12/3/2012)


    I need to refer to a temp table which has all the months and dynamically shows the years.

    for example I need rolling 12 months to show in this table:

    Since there are no DATETIME reference columns in that table, I have to ask... WHY? What and how are you going to use this? I'm not trying to be difficult here. I just see a world of hurt coming up and I'm trying to help you avoid it. In order to do that, I need to know what and how you intend to use this table.

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