• Mike Osborne (1/11/2014)


    Can't update the original table...knowing when the data came in is an important piece of data.

    adding a couple of columns and running a process once in a while to update new data is a good idea.

    I guess I was hoping to find a cheap view so I would not "mess up" the source data tables.

    I said the table has about a million records but the typical query would only return a thousand or less.

    Thanks for your help,

    Mike

    You could probably get away with a MAX where the date is less than date x. You'd need some decent indexing for it to be quick. In 2K12, you could use Lead/Lag functionality for it. It just seems a shame to keep wasting clock cycles on something that will never change.

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