multi column to 1 query

A

Anton

I am trying to create a query that selects data from 15
or 20 columns.
The unique results should be presented in a single
column, so it can be used as a pick list.
Is this possible?
And if so, how dshould I do it?

Thanx in advance.
Anton
 
R

Rick B

Sounds like your data structure may not be normalized. Similar data in 15
or 20 fields sounds more like a one-to-many relationship. What is your
table structure? What are the fields?

Rick B


I am trying to create a query that selects data from 15
or 20 columns.
The unique results should be presented in a single
column, so it can be used as a pick list.
Is this possible?
And if so, how dshould I do it?

Thanx in advance.
Anton
 
J

John Spencer (MVP)

Take a look at a union query. This should give you the results you are looking
for if it can handle that many unions in one query. Otherwise, you may need to
create a table and populate it with a series of Append queries and then run a
query against that.

SELECT ColumnA
FROM TABLE
UNION
SELECT ColumnB
FROM TABLE
UNION
SELECT ...

A UNION (as opposed to UNION ALL) query will strip out duplicate rows, so you
don't need to use a Distinct clause to get rid of duplicate values.
 
A

Anton

Thank you John it did the trick.
Anton
-----Original Message-----
Take a look at a union query. This should give you the results you are looking
for if it can handle that many unions in one query. Otherwise, you may need to
create a table and populate it with a series of Append queries and then run a
query against that.

SELECT ColumnA
FROM TABLE
UNION
SELECT ColumnB
FROM TABLE
UNION
SELECT ...

A UNION (as opposed to UNION ALL) query will strip out duplicate rows, so you
don't need to use a Distinct clause to get rid of duplicate values.

.
 
Top