Update Query

G

Guest

I have two tables

company
contacts

I need two copy the RecordID from the "company" table to the "contacts" table where company.companyid = contacts.companyid.

I used the Query Wizrd to create the query without much success.

UPDATE company INNER JOIN contacts ON company.RecordID = contacts.RecordID SET contacts.RecordID = "company_RecordID: RecordID"
WHERE (([company].[companyid]=[contacts].[companyid]));
 
M

mwalts

I have two tables

company
contacts

I need two copy the RecordID from the "company" table to the
"contacts" table where company.companyid = contacts.companyid.

I used the Query Wizrd to create the query without much success.

UPDATE company INNER JOIN contacts ON company.RecordID =
contacts.RecordID SET contacts.RecordID = "company_RecordID: RecordID"
WHERE (([company].[companyid]=[contacts].[companyid]));

It sounds like you have some major normalization issues.

You should never have to have the smae information twice in the same
table, and it looks like the link between Contacts and Company is
already established by the Contacts,companyid=conpany.companyid. That
being said...

try this:
UPDATE contacts, company
SET contacts.RecordID = company.RecordID
WHERE contacts.companyID=company.companyID;

it works.... but once again, I'm not sure why your doing it
this way

Anyway, good luck, and I hope this helps

-mwalts
 

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