Query joining 2 seperate tables

J

Jeffshex

I have 2 tables, let's call them Table1 and Table2. Each have about 5
columns that are similar. Project Number, Project Name, Project Manager, Due
Date, and Status. Is there a way where I can have a query join those
together whenever I click on that query? So I will have one table showing
all the project information in the 5 columns.
Any ideas?
 
D

Duane Hookom

You didn't do a very good job of describing what you mean by "join those
together". A WAG suggests you can use a union query.
 
J

Jeffshex

Yeah, its looking like I need to do a union query and then a make table query.
All's i'm looking to do is put those 2 tables together as 1. I'm just
having some difficulty piecing the join query together (I'm not sure of the
syntax...I see the microsoft examples but those don't help me out much.)

So I guess i'm looking for some good help on doing a union query.
 
D

Duane Hookom

Try syntax like:

SELECT [Project Number], [Project Name], [Project Manager], [Due Date],
[Status]
FROM [Table1]
UNION ALL
SELECT [Project Number], [Project Name], [Project Manager], [Due Date],
[Status]
FROM [Table2];
 
R

Rick Brandt

Jeffshex said:
I have 2 tables, let's call them Table1 and Table2. Each have about 5
columns that are similar. Project Number, Project Name, Project
Manager, Due Date, and Status. Is there a way where I can have a
query join those together whenever I click on that query? So I will
have one table showing all the project information in the 5 columns.
Any ideas?

You need a union query. These cannot be created in the query designer. You
have to write the SQL in the SQL View window of the query.

SELECT [Project Number], [Project Name],
[Project Manager], [Due Date], [Status]
FROM Table1
UNION ALL
SELECT [Project Number], [Project Name],
[Project Manager], [Due Date], [Status]
FROM Table2

By the way...having two table share that many identical fields suggests that
your database is designed incorrectly.
 
J

Jeffshex

Awesome Duane! That is exactly what I needed!!!

Duane Hookom said:
Try syntax like:

SELECT [Project Number], [Project Name], [Project Manager], [Due Date],
[Status]
FROM [Table1]
UNION ALL
SELECT [Project Number], [Project Name], [Project Manager], [Due Date],
[Status]
FROM [Table2];

--
Duane Hookom
MS Access MVP


Jeffshex said:
Yeah, its looking like I need to do a union query and then a make table
query.
All's i'm looking to do is put those 2 tables together as 1. I'm just
having some difficulty piecing the join query together (I'm not sure of
the
syntax...I see the microsoft examples but those don't help me out much.)

So I guess i'm looking for some good help on doing a union query.
 
Top