0

Ok, so after hours and hours of testing and searching online I'm almost convinced that this can't be done, but I'm asking here for help maybe someone can give me any idea as to why this isn't working.

I'm doing this query:

SELECT * FROM(
(SELECT t1.PAG5 from table1 t1 where t1.PAG5 > 0) 
UNION ALL
(select t2.PAG1 from table1 t2 where t2.PAG1 > 0)
)

The bad part: it has to be access 2.0

This gives me an error after the first FROM. I'm guessing access 2.0 doesn't allow nested Select with Union. Is this true?

PS: Running the two Union queries by themselves works.

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by boblarson
0

Ok, so after hours and hours of testing and searching online I'm almost convinced that this can't be done, but I'm asking here for help maybe someone can give me any idea as to why this isn't working.

I'm doing this query:

SELECT * FROM(
(SELECT t1.PAG5 from table1 t1 where t1.PAG5 > 0) 
UNION ALL
(select t2.PAG1 from table1 t2 where t2.PAG1 > 0)
)

The bad part: it has to be access 2.0

This gives me an error after the first FROM. I'm guessing access 2.0 doesn't allow nested Select with Union. Is this true?

PS: Running the two Union queries by themselves works.

I just tried with this and it works:

Select * FROM (SELECT t1.PAG5 from table1 [B]As[/B] t1 where t1.PAG5 > 0
UNION ALL
select t2.PAG1 from table1 [B]As[/B] t2 where t2.PAG1 > 0)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.