• ByronOne (4/11/2013)


    Hi Lynn

    Is it possible to adapt this code slightly so that rather than updating the sales figures for a specified product type ie LEISURE. It creates a new product type ie NEW_LEISURE with the new sales figures.

    Basically I want to update the sales figures but I'd like to keep a record of the old sales figures too.

    Hope that makes sense..

    BO

    You might find it more useful to create a whole new forecast for your new figures. Add a new column say ForecastID to your table. All existing rows take ForecastID = 1, this new iteration takes ForecastID = 2. You can have any number of forecasts in the table.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden