ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Querying Access Database (https://www.excelbanter.com/excel-worksheet-functions/7904-querying-access-database.html)

Edgar Thoemmes

Querying Access Database
 
Hi

Apologise if this is posted to the wrong group.

I have a query set up in an access database and I would like to pull the
results into an excel spreadsheet. I am trying to use External Data Source
and have managed to connect to the database with Microsoft Query.

I tried using the wizard but I couldnt get the result I was looking for. So
I tried it manually and entered the following SQL into the SQL Text box in
Microsoft Query:

SELECT qryMergedTopSuppliers.Vendor, qryMergedTopSuppliers.Descr,
qryMergedTopSuppliers.ABC, qryMergedTopSuppliers.Description,
qryMergedTopSuppliers.SumOfAmount
FROM qryMergedTopSuppliers;

And I get the message 'Could not add the table qryMergedTopSuppliers' am I
missing something here?

I also tried using so SQL from some of my existing queries but these all
brought up errors as well? Can anyone help with this problem or point me in
the direction of some resources?

TIA

Edgar

JulieD

Hi Edgar

not sure why you can't get the result that you want using MSQuery ..
however, when i construct a query with MSQuery and view the SQL the table is
'fully qualified'
e.g.

SELECT Query1.person, Query1.language
FROM `C:\Documents and Settings\JulieD\My Documents\MyDatabase`.Query1
Query1

Maybe you need to make this change to your SQL statement.

However, to get the information you want using MSQuery, you should just need
to select qryMergedTopSuppliers from the list of available tables/queries,
then click on the + next to it to display the fields, choose the fields you
want and then basically click FINISH.

Hope this helps
Cheers
JulieD


"Edgar Thoemmes" wrote in message
...
Hi

Apologise if this is posted to the wrong group.

I have a query set up in an access database and I would like to pull the
results into an excel spreadsheet. I am trying to use External Data Source
and have managed to connect to the database with Microsoft Query.

I tried using the wizard but I couldnt get the result I was looking for.
So
I tried it manually and entered the following SQL into the SQL Text box in
Microsoft Query:

SELECT qryMergedTopSuppliers.Vendor, qryMergedTopSuppliers.Descr,
qryMergedTopSuppliers.ABC, qryMergedTopSuppliers.Description,
qryMergedTopSuppliers.SumOfAmount
FROM qryMergedTopSuppliers;

And I get the message 'Could not add the table qryMergedTopSuppliers' am I
missing something here?

I also tried using so SQL from some of my existing queries but these all
brought up errors as well? Can anyone help with this problem or point me
in
the direction of some resources?

TIA

Edgar





All times are GMT +1. The time now is 02:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com