Solved

Modify query

Posted on 2011-03-21
9
310 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

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

mx
0
 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

828 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