Question : Access 2007 Union Query With Linked Tables

I have a union query with linked tables. When I run the code below with two tables it executes perfectly fine though when I add in the third table it errors saying:

Error in your syntax near "union all select `pencolony2`.`penID`, count(1) from cowcolony2"

Though when I run the code from the MySQL  it executes with out error.

I have to union 30 tables total together.
Code Snippet:
1:
2:
3:
4:
5:
SELECT pencolony1.penID, Count(cowcolony1.cowID) AS CountOfcowID FROM pencolony1 INNER JOIN cowcolony1 ON pencolony1.penID = cowcolony1.penID GROUP BY pencolony1.penID
UNION ALL 
SELECT pencolony2.penID, Count(cowcolony2.cowID) AS CountOfcowID FROM pencolony2 INNER JOIN cowcolony2 ON pencolony2.penID = cowcolony2.penID GROUP BY pencolony2.penID
UNION  ALL 
SELECT pencolony3.penID, Count(cowcolony3.cowID) AS CountOfcowID FROM pencolony3 INNER JOIN cowcolony3 ON pencolony3.penID = cowcolony3.penID GROUP BY pencolony3.penID;

Answer : Access 2007 Union Query With Linked Tables

looks like a bug...

check here : http://bugs.mysql.com/bug.php?id=7684
Random Solutions  
 
programming4us programming4us