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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
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,215,336
Messages
6,124,334
Members
449,155
Latest member
ravioli44

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