saving the results of queries

  • Thread starter Thread starter Dave Kaplan
  • Start date Start date
D

Dave Kaplan

I have developed a union query in SQL that returns well over 100,000 records
and involves 7 tables (see below). Copying and pasting is impossible, and I
would like to be able to save the query as a table (like in Make Table).
How do I go about doing this? Thanks

My SQL looks like this:

SELECT [PARCEL_ID],[CITY], [ADDRESS], [Sale_Amt], [Mgt_Amt], [LAND_USAGE],
[SALE_DATE], [MORTGAGE_DATE]
FROM [Akron1]
WHERE [O_R_B] = "R" and [OWNER_OCCUPIED] = "Yes"
UNION
SELECT [PARCEL_ID], [CITY], [ADDRESS], [Sale_Amt], [Mgt_Amt], [LAND_USAGE],
[SALE_DATE], [MORTGAGE_DATE]
FROM [Akron2]
WHERE [O_R_B] = "R" and [OWNER_OCCUPIED] = "Yes"
UNION
SELECT [PARCEL_ID], [CITY], [ADDRESS], [Sale_Amt], [Mgt_Amt], [LAND_USAGE],
[SALE_DATE], [MORTGAGE_DATE]
FROM [Akron3]
WHERE [O_R_B] = "R" and [OWNER_OCCUPIED] = "Yes"
UNION
SELECT [PARCEL_ID],[CITY], [ADDRESS],[Sale_Amt],[Mgt_Amt], [LAND_USAGE],
[SALE_DATE], [MORTGAGE_DATE]
FROM [Aur_Copley]
WHERE [O_R_B] = "R" and [OWNER_OCCUPIED] = "Yes"
UNION
SELECT [PARCEL_ID],[CITY], [ADDRESS],[Sale_Amt],[Mgt_Amt], [LAND_USAGE],
[SALE_DATE], [MORTGAGE_DATE]
FROM [Cuyah_Monroe]
WHERE [O_R_B] = "R" and [OWNER_OCCUPIED] = "Yes"
UNION
SELECT [PARCEL_ID],[CITY], [ADDRESS],[Sale_Amt],[Mgt_Amt], [LAND_USAGE],
[SALE_DATE], [MORTGAGE_DATE]
FROM [NoCanton_Tallmadge]
WHERE [O_R_B] = "R" and [OWNER_OCCUPIED] = "Yes"
UNION SELECT [PARCEL_ID],[CITY],[ADDRESS],[Sale_Amt],[Mgt_Amt],
[LAND_USAGE], [SALE_DATE], [MORTGAGE_DATE]
FROM [Twins_Wads]
WHERE [O_R_B] = "R" and [OWNER_OCCUPIED] = "Yes";
 
Add INTO MyResults in your SQL as below.

SELECT [PARCEL_ID],[CITY], [ADDRESS], [Sale_Amt],
[Mgt_Amt], [LAND_USAGE], [SALE_DATE], [MORTGAGE_DATE]
FROM [Akron1] INTO MyResults
 
Copying and pasting is impossible, and I
would like to be able to save the query as a table (like in Make Table).

Base a MakeTable query on the Union query. You don't have to base a
query directly on a Table - it can be based on another Query.
 
Thanks -- that works well.


John Vinson said:
Base a MakeTable query on the Union query. You don't have to base a
query directly on a Table - it can be based on another Query.
 
Back
Top