Adding up...

January 30, 2004 by Kutt Niinepuu
I have though on this topic myself, altohugh I have not been able to test this theory in practice :) Make a new variable just before the repeat region loop, for example: $subtotal = 0; (I may be using PHP-specific syntax, since I'm more familiar with it than ASP). Then in the loop add to this initially empty variable the "$price" variable from your recordset: $subtotal = $subtotal + $your_rs->Fields('price'); Now with every iteration the $subtotal gets added the next value from the $your_rs->Fields('price') drawn from the row of your recordset. At the end, all you need to do is to print the contenst of the $subtotal variable: echo $subtotal; Following this example (if you have nested repeat regions) you can add up a $grand_total if needed. I hope this heps a bit, at least in the direction :)