Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ACCESS: UPDATE QUERY- Build Expressions

Status
Not open for further replies.

Kathrynlewis

Technical User
Jun 6, 2002
25
US
I am trying to build an expression in an update query that will give me the info, of unmatched data. For instance I have the following two tables and corresponding fields:
TABLE1:
field1= country -record1 = Netherlands
field2= country Code-record1= NLROT

TABLE2:
field1=country -record 1 = Netherlands
field2=country CODE-recode1 = NLROT
field1=country-record 2 =SPAIN
field2=counrty CODE-record 2= ESALC

I want the update query to find all country and country Codes from Table 2 that are not present in Table1, and update them to Table one.What expression can i build to find all records that do NOT match between the two tables. Thanks for any help.
 
do a left join on country code and look for nulls.
let access do the work for you. Should be able to create a find unmatched query then change to an append query

INSERT INTO table1 ( [field1],field2 )
SELECT table2.[field1],table2.field2
FROM table2 LEFT JOIN table1 ON table2.field1= table1.[filed1]
WHERE (((table1.[field1]) Is Null));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top