Solved

problems with Update query with sub-select

Posted on 2004-03-25
3
1,228 Views
Last Modified: 2010-10-06
I have two tables, Table1 and Table2 of the following structure:

Table1
_______
PersonNumber - Primary key
RecordID
Name
Address
Phone
EmailAddress


Table2
________
RecordID
Email


RecordID is a numeric text field. In Table1 all RecordID are blanks. Table1 and Table2 are related by Table2.Email and Table1.EmailAddress fields. What I want is to transfer RecordID from Table2 to Table1.

I have the following sql statement:

UPDATE Table1 INNER JOIN Table2
ON Table1.EmailAddress=Table2.Email
SET Table1.RecordID=(SELECT Table2.RecordID FROM Table2)

But when I try to run this query I get an error "Operation must use an updateable query"

I'm using ms access
0
Comment
Question by:YZlat
3 Comments
 
LVL 23

Accepted Solution

by:
heer2351 earned 80 total points
ID: 10682099
Your syntax is almost correct:

UPDATE Table1 INNER JOIN Table2
ON Table1.EmailAddress=Table2.Email
SET Table1.RecordID=Table2.RecordID
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 10682121
Same thing, different syntax:

UPDATE Table1 SET RecordID = Table2.[RecordID] FROM Table1,Table2 WHERE Table1.[EmailAddress]=Table2.[Email]
0
 
LVL 35

Author Comment

by:YZlat
ID: 10682176
perfecto!
thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

829 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