Query works in Access but not in SQL Server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • clflyer
    New Member
    • May 2010
    • 5

    Query works in Access but not in SQL Server

    I have two tables, custmast and custaddlinfo. I want to update a field in custaddlinfo, ISPIWebDirector y. Both tables have a common field, custnumber. But I want to select only the records for custaddlinfo where custmast.compan y name = "ACME" the following SQL statement works in Access but does not work in SQL Server. I get the following errors:

    Msg 156, Level 15, State 1, Line 2
    Incorrect syntax near the keyword 'INNER'.
    Msg 102, Level 15, State 1, Line 4
    Incorrect syntax near 'custmast'.

    Here is my command
    Code:
    UPDATE custmast 
    INNER JOIN custaddldetail ON custmast.customernumber = custaddldetail.CustomerNumber 
    SET custaddldetail.ISPIWebDirectory = "download00853_acme"
    WHERE (custmast.companyname="ACME") AND (custmast.customernumber Like "ACME%");
    Last edited by Niheel; May 27 '10, 07:13 PM. Reason: codetags, spacing
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Check your UPDATE syntax....

    Happy Coding!!!

    ~~ CK

    Comment

    Working...