Merging two quries

N

Nai

I am trying to create a query from a table or query to view data as shown.

Original table T:
colA colB colC
1 a x
2 b y
3 c z

Query:
NO:[T][colA] ALPH:[T][colB] or [colC]
1 a
2 b
3 c
1 x
2 y
3 z

Help, Please!
 
N

Nai

Work likes a charm!! Thanks you...
--
Nai


Tom Wickerath said:
Try using a Union query. Something like this:

SELECT colA, colB FROM T
WHERE colA IS NOT Null
UNION
SELECT colA, colc FROM T
WHERE colA IS NOT Null

Here is a tutorial on union queries that you may find helpful:

http://home.comcast.net/~tutorme2/samples/unionqueries.zip


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________

Nai said:
I am trying to create a query from a table or query to view data as shown.

Original table T:
colA colB colC
1 a x
2 b y
3 c z

Query:
NO:[T][colA] ALPH:[T][colB] or [colC]
1 a
2 b
3 c
1 x
2 y
3 z

Help, Please!
 
J

John W. Vinson

I am trying to create a query from a table or query to view data as shown.

Original table T:
colA colB colC
1 a x
2 b y
3 c z

Query:
NO:[T][colA] ALPH:[T][colB] or [colC]
1 a
2 b
3 c
1 x
2 y
3 z

Help, Please!

A UNION query is the solution to this. See UNION in the online help.
You need to create the query in the SQL window - in this example it
will be

SELECT ColA, ColB
FROM T
UNION ALL
SELECT ColA, ColC
FROM T;

John W. Vinson [MVP]
 

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