View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default How to get Excel to retrieve aggregate data from Access

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&"'")
--
- K Dales


"Don MacKinnon" wrote:

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.