Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

Any suggestions

UPDATE PMGTask A
SET A.FK_PMGProjectID = (SELECT
  B.PK_PMGProjectID
  FROM PMGProject B WHERE B.Number = A.FK_PMGProjectID)


Msg 102, Level 15, State 1, Line 86
Incorrect syntax near 'A'.
Msg 156, Level 15, State 1, Line 92
Incorrect syntax near the keyword 'FROM'.
0
wd006451
Asked:
wd006451
  • 3
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
this is the syntax:
 
UPDATE PMGTask
SET FK_PMGProjectID = B.PK_PMGProjectID
FROM PMGTask A
JOIN PMGProject B
  ON B.Number = A.FK_PMGProjectID
0
 
Jeff TennessenAssistant Vice PresidentCommented:
Try this:

    UPDATE PMGTask As A INNER JOIN PMGProject AS B ON B.Number = A.FK_PMGProjectID
    SET A.FK_PMGProjectID = B.PK_PMGProjectID

Access's implementation of SQL is a little weird when it comes to UPDATEs...

Jeff
0
 
Jeff TennessenAssistant Vice PresidentCommented:
Whoops! I got here via Microsoft > Development > MS Access > Queries (SQL), so I mistakenly assumed that this forum was Access-specific. For SQL Server and other RDBMSes, angelIII is quite correct. My apologies for being a dunce!

Jeff
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
JTennessen: no worries. the question is actually cross-posted to the 2 zones.
the error message in fact indicates "clearly" that's sql server and not access...
0
 
Jeff TennessenAssistant Vice PresidentCommented:
angelIII: Yeah, that's what finally clued me in. I need to read the posts more thoroughly before replying!

Thanks,

Jeff
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now