Update table with table

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
 
P

PC

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
 
M

Michel Walsh

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
 
Top