Dennis-
The syntax looks OK, but the query will probably be declared not updatable. In
native Access, you would write it like this:
UPDATE TableA INNER JOIN TableB
ON TableA.Field2 = TableB.Field2
SET TableA.Field1 = TableB.Field1
.. but Field2 would need to be the PKey of one of the two tables.
John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Dennis Davidsson
Sent: Wednesday, October 12, 2011 9:32 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Syntactic limitations in an SQL UPDATE sentence
Hello,
I wonder if the following SQL sentence is syntactically valid in Access:
UPDATE TableA
SET Field1 = (SELECT Field1 FROM TableB
WHERE TableB.Field2 = TableA.Field2)
WHERE TableA.Field2 IN (SELECT Field2 FROM TableB)
Regards
Dennis Davidsson
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
Rabu, 12 Oktober 2011
RE: [MS_AccessPros] Syntactic limitations in an SQL UPDATE sentence
__._,_.___
MARKETPLACE
.
__,_._,___
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar