Help with an Array

woknick

Registered User.
Local time
Yesterday, 17:17
Joined
Sep 25, 2004
Messages
85
I have a table that holds the names of locations and a count for each location. example below

Location Count
INR 100
INR 16
MTU 245
MTU 123
INR 300
RVO 1234
TC 45
TC 188

The table is always changing and I need to create a query in code that sums the count, grouping for each location. These values will need to be stored in a dynamic array for further processing. How do I store this query value into a dynamic array.

array would need to store these values

(INR, 316)
(MTU, 368)
(RVO, 1234)
(TC, 233)


Thanks in advance
 
Why store them in an array? Why not open up a recordset and process the data there.


Select Sum([Count]) From [TableName] GROUP BY [Location]
 
I'm with Keith on this one. Arrays aren't quite useless in Access, but trying to use arrays when there are perfectly good domain aggregate and query aggregate functions seems wasteful.

If in doubt, look up those two topics: Domain Aggregates and SQL Aggregates.
 

Users who are viewing this thread

Back
Top Bottom