A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Union Query to a Table



 
 
Thread Tools Display Modes
  #1  
Old July 8th, 2008, 05:00 PM posted to microsoft.public.access.queries
miss_mas
external usenet poster
 
Posts: 6
Default Union Query to a Table

I created a union query. How do I get the output to go to a new table?
Do I have to CREATE TABLE then use all the INSERT INTO functions or is there
an easier way to do this? I am creating a new table because I need another
database to be able to link to this table.
  #2  
Old July 8th, 2008, 05:06 PM posted to microsoft.public.access.queries
Bob Barrows [MVP]
external usenet poster
 
Posts: 441
Default Union Query to a Table

miss_mas wrote:
I created a union query. How do I get the output to go to a new
table?
Do I have to CREATE TABLE then use all the INSERT INTO functions or
is there an easier way to do this? I am creating a new table because
I need another database to be able to link to this table.


That's probably the appropriate way if you wish to have keys (indexes),
validation rules, etc.

If you simply wish to have a heap of data, then this should work (it works
in SQL Server anyways):

select column_list into newtable from ...
union
select column_list from ...
etc.


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


  #3  
Old July 8th, 2008, 05:08 PM posted to microsoft.public.access.queries
Klatuu
external usenet poster
 
Posts: 7,074
Default Union Query to a Table

Create the table first with the correct field types and lengths. Make Table
queries make assumptions and use defaults that waste memory space.
Create an append query that appends the output of your Union query to the
new table.
--
Dave Hargis, Microsoft Access MVP


"miss_mas" wrote:

I created a union query. How do I get the output to go to a new table?
Do I have to CREATE TABLE then use all the INSERT INTO functions or is there
an easier way to do this? I am creating a new table because I need another
database to be able to link to this table.

  #4  
Old July 8th, 2008, 05:21 PM posted to microsoft.public.access.queries
miss_mas
external usenet poster
 
Posts: 6
Default Union Query to a Table


Thanks, this helps a lot!
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:41 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.