Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accumulate To Array

Status
Not open for further replies.

logic2fun

IS-IT--Management
Mar 19, 2008
8
US
Freinds,
I am trying read some data and sum it up to an array. For example i have this dataset

ID - Code - Reason - Time of Occurence
---------------------------------
A - 123 - 1 - 10:00
A - 0 - 0 - 10:05
A - 125 - 2 - 10:06
A - 0 - 0 - 10:09
A - 123 - 1 - 10:10
A-0 -0-10:20

---------------

I wanted to accumulate time by Code data in an array by CODE and the CODE is not constant.

in the first iteration
123 - 5 minutes
125 - 4 minutes
123 - 10 minutes

My End data is 123 - 15 minutes and 125 - 4 minutes

I am not expecting Huge dataset for this comparision so if search is required we might be OK. i thought of using two dimensional array or a structure with all the elements but but am getting confused on how to search if the CODE already exists and accumulate to that value.

A little code snippet will be of a great help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top