?
Solved

problems with Update query with sub-select

Posted on 2004-03-25
3
Medium Priority
?
1,245 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 23

Accepted Solution

by:
heer2351 earned 320 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 51

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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

777 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