Hello everyone!
I have a database field that stores values like this format "1,3,1,6,0,2,7"
Now i want to perform a SUM function on that field.
For example, the query found 3 results so lets say the values are:
I want to perform a sum function where the output would be like that.Code:Field 1 | Field 2 ------------ | ------------ 2,1,0,1,1,5,2 | 0,0,5,4,0,0,3 | 1,1,4,0,0,1,0 | ------------ | ---------- 3,2,9,5,1,6,5 << expected output
Here is what i started i don't know if it's correct.
There is a flaw in this code. Can somebody help me modify this so that i can sum each element in the array?Code:Dim myArr() As String Dim tmp(6) As String For y = 1 To rs.RecordCount myArr = Split(rs!FieldFromDbase, ",") tmp(y - 1) = tmp(y - 1) + myArr(y - 1) rs.Movenext Next y




Reply With Quote