Joining 2 Tables

  • Thread starter Thread starter carl
  • Start date Start date
How can I join 2 tables that have the same record layouts ?

By using an appropriate query.

Since we don't know anything about the structure of the tables, how they are
related (if at all), nor how you would like them "joined" it's hard to say.

More info please? perhaps an example of what you have and what you want?
 
Thank you for helping.

Table1 is like this:

Day Product Qty
2-Jan 1 10
4-Jan 2 1
6-Jan 3 3

Table2 is like this:

Day Product Qty
2-Jan 1 10
4-Jan 2 1
6-Jan 3 3
1-Feb 1 3
2-Feb 2 3
3-Feb 3 3


Thank you in advance.

Day Product Qty
1-Feb 1 3
2-Feb 2 3
3-Feb 3 3


I am trying to join the 2 table to look like this:
 
Do you mean to say that you want to know what entries in Table2 aren't in
Table1?

Use the Find Unmatched Query Wizard. Go to create a new query, select that
wizard, and let it walk you through the process.
 
Thank you for helping.

Table1 is like this:

Day Product Qty
2-Jan 1 10
4-Jan 2 1
6-Jan 3 3

Table2 is like this:

Day Product Qty
2-Jan 1 10
4-Jan 2 1
6-Jan 3 3
1-Feb 1 3
2-Feb 2 3
3-Feb 3 3


Thank you in advance.

Day Product Qty
1-Feb 1 3
2-Feb 2 3
3-Feb 3 3


I am trying to join the 2 table to look like this:

I presume this was a copy&paste error and that you want to combine the January
data and the February data to produce the six lines?

If so you need a choice of two options:

1. a UNION query. Open the SQL window and type

SELECT [table1].[Day], [table1].[Product], [table1].[Qty]
UNION ALL
SELECT [table2].[Day], [table2].[Product], [table2].[Qty]
ORDER BY [Day];


2. NORMALIZE YOUR DATA!

If you have a separate table for each month your database design IS WRONG.
That makes sense for a spreadsheet (one page per month) but not for a
relational database! Create a new master table, and use a UNION query like the
one above as the source of an append query to move all of the data into one
table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Unique Records 6
Multiple left joins 3
Nested query problem 6
conditional join 3
Inner join and Left Join 1
Joining 10K rows to 10K rows 10
With a Query in Access 2007, How can I Create This Query 3
Linking Tables 4

Back
Top