Update table with table

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

Hello

I am trying to figure out how I can update one table with the
infromation in another based on the tracer number which is the same in
both tables.

I get an update each hour with different information but the tracer
number is always the same

Thanks
Bob
 
Create an update query something like this:

UPDATE Table1 INNER JOIN Table2 ON Table1.TracerNo = Table2.TracerNo SET
Table2.Field1 = Table1.Field1, Table2.Field2 = Table1.Field2, Table2.Field3
= Table1.Field3
WHERE (((Table2.Field1)<>[Table1].[Field1])) OR
(((Table2.Field2)<>[Table1].[Field2])) OR
(((Table2.Field3)<>[Table1].[Field3]));

This assumes the fields names in both tables are the same but will work just
as well if they are not.

hth

Paul
 
Hi,




UPDATE oldTable RIGHT JOIN newData
ON oldTable.Tracer=newData.Tracer
SET oldTable.Tracer=newData.Tracer,
olTable.whaterver = newData.whatever,
...




Hoping it may help,
Vanderghast, Access MVP
 

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