records from 2 tables without any relation

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
 
A

André Hartmann

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.
 
V

Van T. Dinh

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)
 
D

Dan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top