Query to show values that apear in one table but not another (1 Viewer)

ZeDoctor

New member
Local time
Yesterday, 17:03
Joined
Apr 18, 2019
Messages
1
So I have two tables with a field called customer code, this can have the same value duplicated a number of times e.g "CUSTOMER1" can be in 6 rows.

I want then to check all values of this in table1 to see if they appear in table2 and return preferably a list of customer codes with TRUE or FALSE next to them to show if they appear in table2.

I can't work it out, I've also tried running a query to show the values as unique values only recently and this just ran and never finished, I had to force close access during it, do I need more RAM?

Cheers peeps,
 

June7

AWF VIP
Local time
Yesterday, 16:03
Joined
Mar 9, 2014
Messages
5,465
Are you saying the same value can be duplicated numerous times in BOTH tables? Did you try the FindUnmatched query wizard? Depending on how many records are in each table, might not be possible to have enough memory.

If a FindUnmatched query on the 2 tables fails (runs forever), options:

1. build 2 queries to return DISTINCT customer codes for each table, then use those 2 queries in FindUnmatched query

3. use DLookup(), however, domain aggregate function can also run very slowly in query
 

Ranman256

Well-known member
Local time
Yesterday, 20:03
Joined
Apr 9, 2015
Messages
4,339
you want an OUTER join.
in query, bring in both tables,
join on CustCode,
dbl-click the join line,
set to : show ALL records in tbl1, SOME recs in tbl2
bring in CustCode from both tables onto the query grid
run query.
the tbl2.CustCode that is null are the missing recs not in table2.

if you only want to see those,set tbl2.CustCode criteria = null.
 

Users who are viewing this thread

Top Bottom