Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 194
  • Last Modified:

Using MS Access, how can I OR together the results of 3 different queries all returning the same ID field

Using MS Access, I have 3 different queries.  I want to create a 4th query that will OR together the results of the 3 other queries.  All 3 queries return the ID number from the same table.  The 4th query should return the ID number as well where we have combined the results (eliminating duplication) from the 3 other queries.  Thank you.
0
rporter45
Asked:
rporter45
  • 4
  • 3
1 Solution
 
jamesguCommented:
query 1

union

query 2

union

query 3
0
 
rporter45Author Commented:
Does work.

If we had query 1 return this:
1
2
3

Query 2 return this:
4
5
6

Query 3 return this:
2
5
7
8
9

I need query 4 to return:
1
2
3
4
5
6
7
8
9

Does this clarify?
0
 
rporter45Author Commented:
I meant that it does not work above.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jamesguCommented:
what did you get?
0
 
jamesguCommented:
if you wanted the result sorted, do

select id from (
query 1

union

query 2

union

query 3
) BB
order by id
0
 
rporter45Author Commented:
I am getting a syntax error as I think I need a JOIN???  How do I join the 3 queries?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now