>Ko,
>
>Your result is not what I want:
>
>Sample:
>1999 01 20
>1999 01 30
>1999 03 40
>2000 01 10
>2000 01 15
>2000 02 20
>2000 03 10
>
>Result should be:
>1999 01 50 2
>1999 03 90 3
>2000 01 25 2
>2000 02 45 3
>2000 03 55 4
>
>
>See the difference with your result?
Sorry,
After looking again at my post i see that you added a comment to my post in the post itself.
Now i see the problem.
Just a simple typo.
For Table2 in the line of 02 2000 the amount should be 22 instead of 20.
Sorry again for misleading you,
But the code itself gave the wanted result.