Access union query not showing in Excel connection list

Joined
Mar 23, 2004
Messages
241
Hi all,

I've done a few searches for this, and while others seem to be having the same problem, the causes seem like they might be different.

I'm trying to connect to a union query in Access from Excel (both on Office 365 and updated). I built the two different select queries separately as '1' and '2' then smooshed them together into union query '3'. All three queries work as expected in Access.

When I try and connect to the Access DB from Data > Get Data in Excel, only queries 1 and 2 appear in the selection list, not union query 3.

From what I understand from other posts, there might be an issue with using Access-specific commands in the SQL, but both 1 and 2 work just fine, so it seems it's the union aspect of 3 that's preventing it appearing.

Does anyone have any suggestions on how to connect to this union query?

If it helps, the only bit of Access SQL code I'm using, as far as I'm aware, is to compare to a previous date, so if anyone has another method for me to try for this that'd be great too:

<=DateAdd("yyyy",-1,Date())

Thanks in advance for your help! :)

Bill
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi, have you considered doing the UNION in Excel?

i.e. in the connection properties make the Command Type: SQL and the Command Text:

SELECT * from Query1 UNION SELECT * FROM Query1
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top