Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2009
    Posts
    1

    Unanswered: Need Help on update sql

    i have 3 tables

    Table1
    AcctNo producttypedesc runmonth runyear
    111 teast 9 2009
    222 tesdfst2 8 2009
    333 tesgsg 9 2009

    table2

    AcctNo officerID producttypedesc
    111 FADCDG test
    333 98989hh test3

    Table 3

    runmonth runyear
    9 2009


    i want to update producttypedesc to table1 from table 2 based on acctno but at the same time the data should be updated to the row where the table1runmonth and runyear matches with table3 runmonth and run year
    can anybody help?

  2. #2
    Join Date
    Oct 2009
    Posts
    27
    Try the statement below.

    UPDATE Table1
    SET producttypedesc=table2.producttypedesc
    FROM Table1
    INNER JOIN table2
    ON Table1.AcctNo=table2.AcctNo
    INNER JOIN [Table 3]
    ON Table1****nmonth=[Table 3]****nmonth AND Table1****nyear=[Table 3]****nyear




    SQL Server Programmers and Consultants
    Microsoft SQL Server Consultants and Developers - SQL Programmers Chicago

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by keywest View Post
    can anybody help?

    Get a course that talks about run on sentences
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •