Solved

Any suggestions

Posted on 2007-03-21
5
175 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]
ID: 18764333
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
ID: 18765218
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
ID: 18765269
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]
ID: 18765827
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
ID: 18765843
angelIII: Yeah, that's what finally clued me in. I need to read the posts more thoroughly before replying!

Thanks,

Jeff
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
total hours between two times grouped by type 6 43
Create calculation and case in query with times 13 24
Query to Add Late Tolerance 10 60
Create A query for disabled users 5 29
by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

919 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

17 Experts available now in Live!

Get 1:1 Help Now