UPDATE statement with TWO table

D

David P.

Please help me translate the UPDATE statement listed below so that Access
SQL can execute the SQL statement.

Thanks,


UPDATE suppliers
SET supplier_name = ( SELECT customers.name
FROM customers
WHERE customers.customer_id = suppliers.supplier_id)
WHERE EXISTS
( SELECT customers.name
FROM customers
WHERE customers.customer_id = suppliers.supplier_id);
 
J

John Spencer

Perhaps the following is what you want. Before you attempt to use this
query, back up your Suppliers table just in case this does something
other than what you want it to do.

UPDATE suppliers INNER JOIN Customers
ON suppliers.supplier_id = customers.customer_id
SET supplier_name = [customers].[name]
WHERE Customers.Name is Not Null


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 

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