trend Posted July 10, 2006 Posted July 10, 2006 Here is my Org Post.. Org I was going to use an Array, but some people said it would be easier done with a DataTable: Hello, I have an array returned with these fields: Name, AmountDue, TypeID, Description The array is (100,1) and string type My problem is.. Some of the people in the array are in there more than once.. (For example they get a bonus on top of their hourly pay). How can I get an array with each entry having a unique Name.. and where the AmountDue is the combination of all money owed to them? example: OrgArray(100,1) OrgArray(0,0) = "Jay" OrgArray(0,1) = "10.00" OrgArray(1,0) = "Jay" OrgArray(1,1) = "1.00" OrgArray(2,0) = "David" OrgArray(2,1) = "10.00" OrgArray(3,0) = "Erin" OrgArray(3,1) = "10.00" OrgArray(4,0) = "David" OrgArray(4,1) = "1.00" NewArray(100,1) should be something like: "Jay" = NewArray(0,0) "11.00" = NewArray(0,1) "David" = NewArray(1,0) "11.00" = NewArray(1,1) "Erin" = NewArray(2,0) "10.00" = NewArray(2,1) Any ideas? thanks Quote
Gill Bates Posted July 10, 2006 Posted July 10, 2006 Is this data coming out of a database? If so, simply group by the unique identifier for the person, e.g. SELECT PeopleID, SUM(HoursWorked) FROM WorkHistory GROUP BY PeopleID Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.