Updating fields based on values from another table

  • Thread starter Thread starter arod
  • Start date Start date
A

arod

I have a table that has a Symbol column.

I have another table that has two columns OldSymbol and NewSymbol.

Can I write a query that matches up the Symbol with OldSymbol values
and then replaces them with the corresponding NewSymbol?

ie. something along the lines of:
UPDATE Table1 SET Symbol = Table2.NewSymbol WHERE
Symbol=Table2.OldSymbol
(obviously that doesn't work)
 
Open the query in design view and remove the criteria. Click on Symbol field
in the graphic display of the table and drag to the OldSymbol of the second
table.

In the Update To row of Symbol enter [NewSymbol] and run the query.
 
Sweet! Thanks a lot man that worked perfectly.


KARL said:
Open the query in design view and remove the criteria. Click on Symbol field
in the graphic display of the table and drag to the OldSymbol of the second
table.

In the Update To row of Symbol enter [NewSymbol] and run the query.

arod said:
I have a table that has a Symbol column.

I have another table that has two columns OldSymbol and NewSymbol.

Can I write a query that matches up the Symbol with OldSymbol values
and then replaces them with the corresponding NewSymbol?

ie. something along the lines of:
UPDATE Table1 SET Symbol = Table2.NewSymbol WHERE
Symbol=Table2.OldSymbol
(obviously that doesn't work)
 

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

Back
Top