records from 2 tables without any relation

  • Thread starter Thread starter Mich
  • Start date Start date
M

Mich

Hi,

I want the records from two tables without any relation:
select field1 from table1 + select field1 from table2
In fact, it's the addition of both recordsets.
I thought something like UNION, but i'm not sure.

Thanks
mich
 
I want the records from two tables without any relation:
select field1 from table1 + select field1 from table2
In fact, it's the addition of both recordsets.
I thought something like UNION, but i'm not sure.

You can do a union provided that both fields have the same data type.
otherwise it wont work.

SELECT field1 FROM TABLE table1
UNION

SELECT field1 FROM TABLE table2

If both have different data types you might want to pick a type that you
can convert both into.. CHAR for example.
 
IIRC, if the 2 Source Field are of different types, the UNION Query still
works but the type of Field values in the combined Column becomes Variant
data type.

--
HTH
Van T. Dinh
MVP (Access)
 
thanks both


Van T. Dinh said:
IIRC, if the 2 Source Field are of different types, the UNION Query still
works but the type of Field values in the combined Column becomes Variant
data type.
 
Back
Top