• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • 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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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