Vensia said:
The SQL statement is like this :
SELECT * FRM qryA
UNION
SELECT * FRM qryB
The query returns error but if I change the SQL statement like this
SELECT * FRM qryB
UNION
SELECT * FRM qryA
The query doesn't return error.
I assume "FRM" was really "FROM" in the SQL.
The complexity is likely in one of the Queries [qryA] or [qryB].
One way to break it up, though it will clutter your database, is to
convert part of your Query to a Make-Table Query or an Append Query,
putting the results into a new Table that you can then delete after you
have finished using it.
In the case of your UNION, you could use a Make-Table Query out of
[qryA] and an Append Query out of [qryB]. An ordinary Select Query
could then return whatever you need from that new Table. If you want to
combine all these operations into a Macro, you could run them, using the
Macro, without any manual intervention.
-- Vincent Johns <
[email protected]>
Please feel free to quote anything I say here.