Merge 2-5 Tables into 1

G

Guest

I have mutiple tables that are linked to an Excel file. I would like to be
able to create a query that will combine all of the tables into one. My data
is as follows:

Table 1
Mfg Sep Oct Nov Dec Jan
GM 100 100 100 50 100

Table 2
Mfg Sep Oct Nov Dec Jan
Jag 50 50 25 0 10

I need to create either a table or query to combine the 2 above.
 
D

Duane Hookom

You can use a union query to "combine" records from multiple tables into a
single record set.
SELECT Mfg, Sep, Oct, Nov...
FROM Table1
UNION ALL
SELECT Mfg, Sep, Oct, Nov...
FROM Table2;

I would normalize this but I don't know your application as well as you.
 
J

John Spencer

That sounds like a union query which can only be done in the SQL (Text) window.

SELECT Mfg, Sep, Oct, Nov, Dec, Jan
FROM [Table 1]
UNION ALL
SELECT Mfg, Sep, Oct, Nov, Dec, Jan
FROM [Table 2]
ORDER BY Mfg

Note that the Order by clause is optional, is added after all the unions, and
uses the field names from the first query in the union query.
 
G

Guest

Thanks Duane. That worked!!!

Duane Hookom said:
You can use a union query to "combine" records from multiple tables into a
single record set.
SELECT Mfg, Sep, Oct, Nov...
FROM Table1
UNION ALL
SELECT Mfg, Sep, Oct, Nov...
FROM Table2;

I would normalize this but I don't know your application as well as you.
 
G

Guest

Thanks John. The join worked!

John Spencer said:
That sounds like a union query which can only be done in the SQL (Text) window.

SELECT Mfg, Sep, Oct, Nov, Dec, Jan
FROM [Table 1]
UNION ALL
SELECT Mfg, Sep, Oct, Nov, Dec, Jan
FROM [Table 2]
ORDER BY Mfg

Note that the Order by clause is optional, is added after all the unions, and
uses the field names from the first query in the union query.
I have mutiple tables that are linked to an Excel file. I would like to be
able to create a query that will combine all of the tables into one. My data
is as follows:

Table 1
Mfg Sep Oct Nov Dec Jan
GM 100 100 100 50 100

Table 2
Mfg Sep Oct Nov Dec Jan
Jag 50 50 25 0 10

I need to create either a table or query to combine the 2 above.
 

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


Top