learner
Feb 6 2006, 09:09 PM
Is it possible to output the result of a union query to a table? Thanks.
truittb
Feb 6 2006, 09:16 PM
Yes, but not directly. You must save the query and use it to create an append query.
learner
Feb 6 2006, 09:21 PM
Currently, I've a report linked to that query, so that the result will be shown in the report. How do I "save the query"? Should I use a macro to "save the query" and "create an append query", then link the report to the new table from the append query instead? Thanks.
truittb
Feb 6 2006, 09:26 PM
Is the query linked to the report already a saved query, or is the SQL in the Recordsource of the report?
I wouldn't use a macro to create a query, just use the query designer and save it like any other query.
I would not create a table just for a report, you have already got the source in the query. Don't add anymore overhead.
learner
Feb 6 2006, 09:54 PM
The Recordsource of the report is the name of the query not the SQL. Is that why you mean by "saved" query?
I can't get the report to show the data as I wanted (the values of one of my fields from the union query will be the column headings (unbound text) and the values of another field will be the row headings (unbound text) & I need to count the entries and tally it in a sort of matrix in the report). I did something similar before but the source for that old report was a table, hence I thought I should output the result of the union query to a table first. Do you think this is redudant, would I be able to create this kind of report directly from the union query? Also, the union query is based on a parameter (date range), so I thought that if my report is linked to a smaller resultant table instead of a union query of two large tables, the performance will improve, is that not so?
There are still lots I don't know about Access, so please bear with me if my questions seem a little trivial. Thanks a lot for your advice.
truittb
Feb 6 2006, 10:06 PM
Yes the query as you describe it is a saved query.
I try to avoid creating temp tables if possible. But that is up to you. If you have the data to run a make table query, you have it available to run the report from the query.
learner
Feb 6 2006, 10:14 PM
Well, I'll try to work on my report from the query again to see if I can get the result I want before using the temp table solution. Thanks a lot.
truittb
Feb 7 2006, 08:07 AM
You are welcome.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.