Query an Access Query in another database

B

bconner

What is the syntax for quering a query in another access database? I am
wanting to query several queries in several different access databases and
pull them together using a Union query.
 
J

Jeff Boyce

You might try something like:

SELECT *
FROM QueryName IN '\\server\path\AccessFileName';

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
L

Lou

What is the syntax for quering a query in another access database? I am
wanting to query several queries in several different access databases and
pull them together using a Union query.

A table in a remote database can be referenced by specifying its name
and file location.

SELECT AddressStreet, AddressCity, AddressState
FROM Table1 IN "E:\ACCESS\FirstDB.mdb"
UNION ALL
SELECT AddressStreet, AddressCity, AddressState
FROM Table2 IN "E:\ACCESS\SecondDB.mdb"

To avoid using the "IN" clause, employ the menu items

GetExternalData
and
Link Tables

If done in this second way, all that needs to be referenced is

SELECT AddressStreet, AddressCity, AddressState
FROM Table1
UNION ALL
SELECT AddressStreet, AddressCity, AddressState
FROM Table2
 

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