Solved

Modify query

Posted on 2011-03-21
9
308 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

919 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