Query to update table with data from another

P

Paul Wilson

Hi,

I have 2 new tables which are originally from a single table. I wish to
update "CONTACTS" table's "DEALERID" field from the "DEALER" table's "ID"
field based on "DEALERNAME" which appears in both tables?
 
J

Jeff Boyce

Paul

Have you looked into UPDATE queries?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
K

KARL DEWEY

Backup your database first. Backup your database first.

You also might want to run a select query first like this --
SELECT SET [CONTACTS].[ID], [DEALER].[ID]
FROM [CONTACTS] INNER JOIN [DEALER] ON [CONTACTS].[DEALERNAME] =
[DEALER].[DEALERNAME]
WHERE ((([CONTACTS].y) Is Null));

Then do update --
UPDATE [CONTACTS] INNER JOIN [DEALER] ON [CONTACTS].[DEALERNAME] =
[DEALER].[DEALERNAME] SET [CONTACTS].[ID] = [DEALER].[ID]
WHERE ((([CONTACTS].y) Is Null));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top