PeasNCarrots
Programmer
I would like to add sub-totals within the recordset results on my asp page. I want the results to be displayed after the corresponding set of related records. Currently, my results are in a table created by the following code.
<table border="0" width="90%" cellspacing="0" cellpadding="2">
<tr>
<%
Dim I
For I = 0 To RS.Fields.Count -1
response.write "<th BGCOLOR = ""C0C0C0""><font size = ""2""><b>" & RS.Fields(I).Name & "</b></font></th>"
Next
%>
</tr>
<%
Do While Not RS.EOF
Response.Write "<tr>"
For i = 0 to RS.Fields.Count -1
Response.write "<td align=""center"" bgcolor=""#F7EFDE""><font size = ""2"">" & RS.Fields(I).Value & "</font></td>"
Next
Response.Write "</tr>"
RS.MoveNext
Loop
%>
</table>
I was thinking about running a sub-total query and then appending data from both recordsets into a new table, and then display the table's recordset? What would be the best approach?
<table border="0" width="90%" cellspacing="0" cellpadding="2">
<tr>
<%
Dim I
For I = 0 To RS.Fields.Count -1
response.write "<th BGCOLOR = ""C0C0C0""><font size = ""2""><b>" & RS.Fields(I).Name & "</b></font></th>"
Next
%>
</tr>
<%
Do While Not RS.EOF
Response.Write "<tr>"
For i = 0 to RS.Fields.Count -1
Response.write "<td align=""center"" bgcolor=""#F7EFDE""><font size = ""2"">" & RS.Fields(I).Value & "</font></td>"
Next
Response.Write "</tr>"
RS.MoveNext
Loop
%>
</table>
I was thinking about running a sub-total query and then appending data from both recordsets into a new table, and then display the table's recordset? What would be the best approach?