How to compare 2 tables - Need help (1 Viewer)

HDIT

New member
Local time
Yesterday, 17:09
Joined
Jun 3, 2018
Messages
3
I have 2 tables that has similar structure
Ex
Tlb1:
Part number Box
A 123 456. TD
A 123 457. TD
A 123 458. DB
A 123 460. DB
A 123 466. TB

Tlb2:
Part number Box
A 123 456. TD
A 123 457. TD
A 123 458. DB
A 123 462. DB
A 123 466. TB

How to compare 2 tables data that get only records have Partnumber and Box the same value as result:

A 123 456. TD
A 123 457. TD
A 123 466. TB

Please help me to solve this problem
Thank you so much
 

isladogs

MVP / VIP
Local time
Today, 01:09
Joined
Jan 14, 2017
Messages
18,209
Create a query & add both tables to it.
Join the 2 fields in both tables

Now add both fields to the query design and run it

There is an obvious question. Why do you have 2 tables with the same structure & duplicated data.

P.S. Welcome to the forum
 

jdraw

Super Moderator
Staff member
Local time
Yesterday, 20:09
Joined
Jan 23, 2006
Messages
15,379
Colin has asked the basic question --why 2 tables with same structure? And has given a method to resolve/identify common values in the two tables.
However, I note this is your first post and offer the following for consideration.

What is the "business" that this database is intended to support? You and readers need a description of the "Issue" in context in order to offer focused advice. What do the tables represent? How are they related to one another?

You are asking readers to identify records in 2 tables where data values of selected fields are equal.

I have seen posts where the OP is looking to programmatically identify the differences in structure of two tables.

Good luck and welcome.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:09
Joined
May 7, 2009
Messages
19,229
and use Inner Join in your query:

Select table1.[Part Number], table1.[Box] From table1 Inner Join table2 On table1.[Part Number] = table2.[Part Number] And table1.[Box] =table2.[Box];
 

HDIT

New member
Local time
Yesterday, 17:09
Joined
Jun 3, 2018
Messages
3
This file that i need you help.
two tables have same structure, i need compare data of these tables and just take datas like that:
Example:
In table C250 and Table C300 , they have these datas are the same at field (Box and Part Number) then get them, if not, ignor:

Box Part number
A75 A 205 350 90 32
A75 A 205 350 90 32
A75 A 205 350 90 32
A75 A 205 350 90 32
A75 A 205 350 90 32
A75 A 205 350 90 32
A75 A 205 350 90 32
A75 A 205 350 90 32
A75 A 205 350 90 32
A75 A 205 350 90 32
A75 A 205 350 90 32
A75 A 205 350 90 32
A75 A 205 350 90 32
A75 A 205 350 90 32
A75 A 205 350 90 32
A75 A 205 350 90 32

This is my access file need help . Thanks
drive.google.com/open?id=11sCnumhUCSYURU411RNwT9seqMwUrxYQ
 

isladogs

MVP / VIP
Local time
Today, 01:09
Joined
Jan 14, 2017
Messages
18,209
HDIT

You have already been told how to do this by two different people but you have not acknowledged any of the responses given so far.
Have you tried doing what was suggested both by myself and by arnelgp?
The instructions are straightforward. Please try yourself.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 01:09
Joined
Jul 9, 2003
Messages
16,273
I believe I've used the Unmatched Query Wizard, and reversed the results to solve this type of problems in the past but I am not at my computer to see if I can replicate what I think I've done before.

But give it a whirl with the unmatched query wizard....

Sent from my SM-G925F using Tapatalk
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 01:09
Joined
Jul 9, 2003
Messages
16,273
I believe I've used the Unmatched Query Wizard, and reversed the results to solve this type of problems in the past but I am not at my computer to see if I can replicate what I think I've done before.

But give it a whirl with the unmatched query wizard....

Sent from my SM-G925F using Tapatalk

Unfortunately the unmatched query wizard only works on one field...
 

isladogs

MVP / VIP
Local time
Today, 01:09
Joined
Jan 14, 2017
Messages
18,209
Unfortunately the unmatched query wizard only works on one field...

It can easily be adapted for two or more fields.
However the OP started by saying the aim was to identify matching records and he has been told how to do this. When he later said any that didn't match could be discarded, did he mean 'could be ignored' or 'could be deleted'?

I'm not sure this thread can progress further unless the OP actually responds to what has been written so far.
 

HDIT

New member
Local time
Yesterday, 17:09
Joined
Jun 3, 2018
Messages
3
Create a query & add both tables to it.
Join the 2 fields in both tables

Now add both fields to the query design and run it

There is an obvious question. Why do you have 2 tables with the same structure & duplicated data.

P.S. Welcome to the forum

First, thank you for your reply. I tried but the result is not right. I dont know where my wrong is

please help, my file below :
drive.google.com/open?id=15PMa2ihE4OwWAflqfjKkEh5POXS6iY6V
 

isladogs

MVP / VIP
Local time
Today, 01:09
Joined
Jan 14, 2017
Messages
18,209
Sorry but many regular forum users including myself do not open external files.

Remove all items except those needed to see the issue, zip and upload here.
When you d so, explain what people should look at.
 

Users who are viewing this thread

Top Bottom