How to get Excel to retrieve aggregate data from Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to get aggregate data (SUM) from a multitable .mdb in Access using
an Excel VBA macro. The aggregate uses three tables and four or five limiting
criteria. I'm simply trying to retrieve a single aggregate figure from Access
rather than a worksheet full of data that requires further Excel calculations.
 
For a single cell query like this it is easiest to use the worksheet function
SQL.REQUEST (see Help for details). Your SQL query can return a sum and you
can effectively have "parameters" if you concatenate cell values as part of
your query string, e.g:
"SELECT SUM(PROFIT) FROM SALES WHERE STATE='"&A1&"'")
 

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

Back
Top