sterjo
Member
- Joined
- Aug 13, 2006
- Messages
- 5
- Programming Experience
- Beginner
I have an access database which has 4 columns sum, sum1,sum2,sum3. The database fills only columns sum and sum1, sum2 and sum3 are epmpty they can be also virtualy created, i don't mind that, because I only need to get the calcualtion displayed in a datagrid. So the code should compare each record in sum and sum1 and if sum is larger than sum1 it should subtract it and pass it to the dummy column. Now if sum1 is larger than sum, the difference goes to another dummy column. However, the code should also check the numbers in virtualy created columns and if previous record is larger than the next one it should substract it again. It should be some sort of circular reference, now I have achievd this in an old programming database language but here I have no idea. so as I mentioned before
SUM sum1 sum2 sum3
1 0 1 0
1 0 2 0 (record of sum is added to the previous record of sum2)
0 1 1 0 (now a record is added to sum1, but since sum2 > sum1, it substratcs it )
0 2 1 1 ( now sum1 >sum2 and the difference goes to sum3)
0 3 0 2 ( once again since sum1 is larger than sum it substratcts sum2 and it passes the value to to sum3)
God I hope I dind't confuse you, when this was introduced to me, I was like trhis I hope someone can help me with this casue I have no idea how to solve this. In addition, I should add the fact that I'm still learning the visual studio.
SUM sum1 sum2 sum3
1 0 1 0
1 0 2 0 (record of sum is added to the previous record of sum2)
0 1 1 0 (now a record is added to sum1, but since sum2 > sum1, it substratcs it )
0 2 1 1 ( now sum1 >sum2 and the difference goes to sum3)
0 3 0 2 ( once again since sum1 is larger than sum it substratcts sum2 and it passes the value to to sum3)
God I hope I dind't confuse you, when this was introduced to me, I was like trhis I hope someone can help me with this casue I have no idea how to solve this. In addition, I should add the fact that I'm still learning the visual studio.