Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get a total from loop 1

Status
Not open for further replies.

meldrape

Programmer
May 12, 2001
516
US
Greetings,

I have the following code:

do until oAction.EOF
if oAction(&quot;trnamount&quot;)< oAction(&quot;regfeecharged&quot;) then
unpaid=oAction(&quot;regfeecharged&quot;)
else
unpaid=0
end if
oAction.MoveNext
Loop

If I response write this out, I get a string of the unpaid fees. What I need is a total of these fees and a count. Is this possible with the result of the loop?

Thanks in advance!
 
Something like this maybe? (Psuedocode)

count = 0
total = 0
do until oAction.EOF
count = count + 1
if oAction(&quot;trnamount&quot;)< oAction(&quot;regfeecharged&quot;) then
unpaid=oAction(&quot;regfeecharged&quot;)
total = total + unpaid
else
unpaid=0
end if
oAction.MoveNext
Loop

Then response.write count and total and see if you have the values you were expecting. ====================================
I love people. They taste just like
chicken!

 
Well, Mithrillhall, you did it. Thanks so much. You saved me an enormous headache!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top