Union query

Lyncroft

QPR for ever
Local time
Today, 21:48
Joined
May 18, 2002
Messages
168
I've 2 tables and I've managed to do a union query to collate the information. Each table also has another 1 field with unlike data. Is it possible using SQL just to add these two field columns at the end of the query or is that a total no-no for Union Queries.

Many thanks
 
It is possible. Just use Null for dummy text fields and 0 for dummy numeric fields.


The following example adds FieldA from Table1 and FieldB from Table2 in a Union Query:-

SELECT ID, Location, FieldA, null as FieldB
FROM Table1
UNION
SELECT ID_NO, Location, null, FieldB
FROM Table2;
 
Cheers Jon

Thats really helpful!!
 

Users who are viewing this thread

Back
Top Bottom