UPDATE Method

I have a column of values in one table that needs to be updated based on an adjustment factor in another table. The table which contains the adjustment factors is built with the following column names.

RangeBeg RangeEnd Factor

The factor is determined depending on where the value falls in the range. I have been trying to do an sql script with no luck. Any Help would be appreciated.

Thanks



Answer this question

UPDATE Method

  • Diamantregen

    Hi,

    this could be something like (just guessing because we really need the DDL and some sample data to see how your actual design is working):

    UPDATE SomeTable
    SET SomeValue =
    (
    SELECT SomeUpdateValue FROM AnotherTable AT WHERE ST.SomeRangeValue BETWEEN AT.RangeStarting AND AR.RangeEnding
    )
    FROM SomeTable ST

    HTH, Jens Suessmeyer.

    ---
    http://www.sqlserver2005.de
    ---


  • nick5454

    Can you post your script

  • PedroSimao

    Jens,

    Thank you. This answered my question.

    Ken


  • UPDATE Method