Solved

Modify query

Posted on 2011-03-21
9
307 Views
Last Modified: 2012-08-13
How can I modify query to make table from union query.

I should use only 1 query (I know how to do it in 2 queries, I need to do it in 1 query)

SELECT [Insurance Payees].*
FROM [Insurance Payees]
UNION SELECT [Tax Payees].*
FROM [Tax Payees];
0
Comment
Question by:maximyshka
  • 5
  • 3
9 Comments
 
LVL 75
ID: 35183856
I don't think you can.  You need to save the UNION query as a named query, then create a MakeTable query from that ...

mx
0
 

Author Comment

by:maximyshka
ID: 35183936
That I know myself.  So Answer is not possible?
0
 
LVL 10

Accepted Solution

by:
answer_dude earned 500 total points
ID: 35183951
This should work:
SELECT MyUnion.* INTO zzMyNewTable
FROM 
(SELECT [Insurance Payees].*
FROM [Insurance Payees]
UNION SELECT [Tax Payees].*
FROM [Tax Payees]) as MyUnion

Open in new window

0
 
LVL 75
ID: 35184132
That does seem to work, technically not a UNION query by itself.  But it is one query.

mx
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 10

Expert Comment

by:answer_dude
ID: 35184270
It is a make table query based on a union query - done in one statement and saved as one Query object in Access - which answers the question asked.
0
 
LVL 10

Expert Comment

by:answer_dude
ID: 35184278
It is a make table query based on a union query - done in one statement and saved as one Query object in Access - which answers the question asked.
0
 
LVL 75
ID: 35184285
I see that ... and it's a cool solution.

mx
0
 
LVL 10

Expert Comment

by:answer_dude
ID: 35184291
It is a make table query based on a union query - done in one statement and saved as one Query object in Access - which answers the question asked.
0
 
LVL 10

Expert Comment

by:answer_dude
ID: 35184368
apologies for the annoying-multiple posts...  made update from phone and it posted several times

:-(

won't do that again...
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now