• No problem.

    So the ddl for ACRT should look like this?

    CREATE TABLE ACRT

    (

    CNO CHAR(100) NOT NULL,

    OPICSCNO CHAR(100) NULL,

    MOODYSRATE CHAR(10) NOT NULL,

    SNPRATE CHAR(10) NOT NULL,

    FITCHRATE CHAR(10) NOT NULL,

    MOODYSIRB NUMERIC(4) NULL,

    SPIRB NUMERIC(4) NULL,

    FITCHIRB NUMERIC(4) NULL,

    MOODYSWATCH BIT DEFAULT 0 NOT NULL,

    SPWATCH BIT DEFAULT 0 NOT NULL,

    FITCHWATCH BIT DEFAULT 0 NOT NULL,

    MIDRATEAGENCY CHAR(10) NULL,

    MIDRATING CHAR(10) NULL,

    MIDIRB NUMERIC NULL,

    NEGWATCH BIT DEFAULT 0 NOT NULL

    )

    I need some explanation as to what you are trying to do.

    so what im trying to do is if in the acrt table or table 2 if the NEGWATCH =1 then for MIDIRB in the acrt table or table 2 i want to add the next value from irbt or table 1.

    so

    say negwatch =1 and midird before this update is 16 then when update is done and from the irtb table or table 1 the midirb = 20 as the next number in the irbt table after 16 is 20

    hope this is better explained but not so sure

    Do you need to update ACRT? Both rows in ACRT have NEGWATCH = 1 so both rows should be updated? What is the logic for the update?

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/