aggregate in ( union query ) run slow

Falcon88

Registered User.
Local time
Today, 23:41
Joined
Nov 4, 2014
Messages
318
i have union query , i need to do some Sum and Count fields in a new query from this union query .
the union query no problem when open .
but the new aggregate query that is based on that union query run slow.

what is the problem.
 
Easiest thing to do is dump your Union Query Data into a Temp_Table and run your Sum and Count fields in a new query against the Temp_Table. You'll have to flush the Temp_Table Contents each time your dataset is new in order to run your process, but otherwise this should speed things up quite a bit.

If you don't want to use a Temp_Table you can make a DAO.Recordset from the Union Query results and then run your calculations against the Recordset.

You may even need to ask yourself, why is your data, which is similar in content, existing in 2 or more different tables that you feel the need for a union query anyway.

Cheers!
Goh
 
Please give me some Temp_Table based on Union Query Example.
 
Show us the query and some description of what it represents; why is it a union etc...
 
If your union query is already made then use it as the source for a MAKETABLE Query
SELECT INTO Temp_Table
FROM [YourUnionQuery];​

Do this one time and you have the structure of the table you need.
Your Temp_Table may shed some light on the data and the data properties you are uniting.

Then lets talk about the tables you are combing into the Union Query like jDraw was asking

Cheers!
Goh
 

Users who are viewing this thread

Back
Top Bottom