Can I first ask that you go back to the posts you have already created and let people know if their answers to your questions have worked for you? I see no replies from you, but a lot of new posts.
The code you are talking about here is not C/AL code, but code created in the new report designer, what is the DateDiff function?
Can you not write some logic to code in a running total?