Help with an Array (1 Viewer)

woknick

Registered User.
Local time
Today, 12:31
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
 

KeithG

AWF VIP
Local time
Today, 12:31
Joined
Mar 23, 2006
Messages
2,592
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]
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 14:31
Joined
Feb 28, 2001
Messages
27,323
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

Top Bottom