Associate
- Joined
- 21 Feb 2004
- Posts
- 886
Hi, I’ve got a result set in asp which is being looped though until end of file. It is being displayed in a table. What I want to achieve is adding up all of one column so I have a total of a particular column. I can’t seem to figure it out, here is my code:
Basically, there’s going to be multiple "parttotal" and I want to add all these up for the amount I have.
Please could some one help? Thank you in advance.
Code:
<%while not adoRS.EOF
dim parttotal
parttotal = (adoRS.fields(2).value * adoRS.fields(3).value)
%>
<tr>
<td align="center"><%=adoRS.fields(0).value%></td>
<td align="left"> <%=adoRS.fields(1).value%></td>
<td align="center"><%=adoRS.fields(2).value%></td>
<td align="center"><%=adoRS.fields(3).value%></td>
<td align="center"><%=parttotal%></td>
</tr>
<%
adoRS.MoveNext
wend%>
Basically, there’s going to be multiple "parttotal" and I want to add all these up for the amount I have.
Please could some one help? Thank you in advance.