Combine two tables of data into one query (1 Viewer)

Number11

Member
Local time
Today, 02:08
Joined
Jan 29, 2020
Messages
607
So i have two large tables of data - in fact linked excel spreadsheets that hold serial number for equipment one table hold xx manufacture and the other another xxx manufacture both tables have the sam field name i want to use

Manufacture_Date
Serial_Number
Last_ImpectionDate

need to have all the data in one new query so i can pull in this data using just the Serial Number but have just one pass against all data
 

plog

Banishment Pending
Local time
Yesterday, 20:08
Joined
May 11, 2011
Messages
11,638
Most likely you want a UNION query:

 

Number11

Member
Local time
Today, 02:08
Joined
Jan 29, 2020
Messages
607
Most likely you want a UNION query:

Ok thanks so i can do that on all 3 fields in the two tables then?
 

Minty

AWF VIP
Local time
Today, 02:08
Joined
Jul 26, 2013
Messages
10,366
A union query is the answer.

Code:
Select "xxx" as Manu , Manufacture_Date , Serial_Number , Last_ImpectionDate FROM tableXXX

UNION

Select "yy" as Manu , Manufacture_Date , Serial_Number , Last_ImpectionDate FROM tableYY

Edit: Damn @plog has faster fingers.
 

MushroomKing

Registered User.
Local time
Yesterday, 18:08
Joined
Jun 7, 2018
Messages
100
Plog is right.
You could make 2 (lets say A and B) queries for your 2 tables.
Then make a new query (C).
Now copy the SQL code from query A and B and put them into the SQL editor of C.

In between those 2 blocks of code, put the word UNION.

If you run your query, it will "merge" A+B.

Hope kinda makes sense.
 

Users who are viewing this thread

Top Bottom