>Yes , i want that in a SELECT SQL, to display it to a grid
I would probably do the following: SELECT the required fields, including sum=0. Make the cursor R/W. Use a SCAN loop, to accumulate and replace the totals.
I don't know if there is a simpler solution.
Hilmar.
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)