Skip to main content
Participant
January 26, 2007
Question

Math Functions

  • January 26, 2007
  • 3 replies
  • 258 views
I have an .asp page that returns a list of payments. Is there any way to add the columns of payments into totals (and/or subtotals)?

This is really kicking my tail and I need to get it figured out, but I haven't found a definitive answer anywhere yet.

Please help!
This topic has been closed for replies.

3 replies

Inspiring
January 26, 2007
I guess it doesn't really matter, really. The whole page is buffered in
IIS, so it could go anywhere. I personally prefer to keep all the code in
one place. So if I were doing it, I'd create the variable just before the
loop itself. That way it doesn't get lost in the shuffle.

Best regards,
Chris

"jroxit333" <webforumsuser@macromedia.com> wrote in message
news:epdbmf$ose$1@forums.macromedia.com...
> Should I insert the code for the variable in the programming for the table
> in the body of the page, or insert the variable in the head of the page
> where the recordset is created? THANKS!


jroxit333Author
Participant
January 26, 2007
Should I insert the code for the variable in the programming for the table in the body of the page, or insert the variable in the head of the page where the recordset is created? THANKS!
Inspiring
January 26, 2007
Presumably, the column of payments is coming from a looped recordset?

If this is the case, create a variable that simply adds the current value to
the previous value as it loops through the recordset. Something like
(pseudocode):

<%
myValue=0
While not recordset.EOF
myValue = myValue + recordset.field
Wend
%>

Then display myValue at the end of it all.

Best regards,
Chris

"jroxit333" <webforumsuser@macromedia.com> wrote in message
news:epd7r2$k8g$1@forums.macromedia.com...
>I have an .asp page that returns a list of payments. Is there any way to
>add
> the columns of payments into totals (and/or subtotals)?
>
> This is really kicking my tail and I need to get it figured out, but I
> haven't
> found a definitive answer anywhere yet.
>
> Please help!
>
>