I have been working in many different access 2003 databases all with a SQL2000 backend with linked tables. In these database I keep running accross the same type of queries. they run very slowly and I think there must be away to rewrite these. Can anyone show me a better way? I created the example of the queries and the final query. I will post them all. query4 in this example is the main query to run.
SELECT Table1.AAA, Table1.BBB, Table1.CCC, Table1.DD, Table1.EE
SELECT Table2.AAA, Table2.BBB, Table2.CCC, Table2.FF, Table2.GG
SELECT Table1.AAA, Table1.BBB, Table1.CCC
UNION SELECT Table2.AAA, Table2.BBB, Table2.CCC
SELECT Query3_Union.AAA, Query3_Union.BBB, Query3_Union.CCC, Query1.DD, Query1.EE, Query2.FF, Query2.GG
FROM (Query3_Union LEFT JOIN Query1 ON (Query3_Union.AAA = Query1.AAA) AND (Query3_Union.BBB = Query1.BBB) AND (Query3_Union.CCC = Query1.CCC)) LEFT JOIN Query2 ON (Query3_Union.AAA = Query2.AAA) AND (Query3_Union.BBB = Query2.BBB) AND (Query3_Union.CCC = Query2.CCC);