Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Math Functions

New Here ,
Jan 26, 2007 Jan 26, 2007
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!
TOPICS
Server side applications
258
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 26, 2007 Jan 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!
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 26, 2007 Jan 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!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 26, 2007 Jan 26, 2007
LATEST
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!


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines