Solved

Any suggestions

Posted on 2007-03-21
5
173 Views
Last Modified: 2010-03-19
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
Comment
Question by:wd006451
  • 3
  • 2
5 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
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
 
LVL 7

Accepted Solution

by:
JTennessen earned 500 total points
Comment Utility
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
 
LVL 7

Expert Comment

by:JTennessen
Comment Utility
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
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
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
 
LVL 7

Expert Comment

by:JTennessen
Comment Utility
angelIII: Yeah, that's what finally clued me in. I need to read the posts more thoroughly before replying!

Thanks,

Jeff
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now