>Thanks for your reply Hilmar,
>
>I need a query like this for both on-screen, as well as report generation.
>I've tried out Borislav's code and it works. However, would you be able to specify how one can use report variables to create the same situation within a report?
Create a report variable, name it, for example, "RunningTotal", assign it the expression to be totalled, for example "Amount". Go to calculations, and select "Sum". Also check the "reset" expression - perhaps you want to reset to zero every time some expression changes.
I am sorry that I can't verify the steps right now, since I am at a computer that doesn't have Visual FoxPro installed.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)