I am doing a report which subtotals the number of points accumulated
for golfers in events they have played during the summer. I am having
trouble at the end of the recordset. When I get to the end of the
recordset I have some code that says to print the last golfer and his
results, but I don't want it to loop again because it creates an error.
Not every player plays in every event, which complicates the code. I
have to show the name of every golfer on the report that earned
Wilwinpts in at least one event. Here is my coding. It prints
everything out including the last record, but I get an error message
you can see at this link.
http://winnetkagolf.com/reporter/playerreportswilwinsummary1a.asp
<% set oRS=server.createobject("ADODB.recordset") %>
<% SQL="SELECT wilwinpt,fname,
Lname from scores,maillist where scores.mailid=maillist.mailid and
wilwinpt > 0 order by lname, fname"
ORS.open SQL, OC, adOpenStatic, adLockOptimistic, adCmdText
Do while not ors.eof
%>
<tr><td>
<% Sum=0
fname=ors("fname")
lname=ors("lname")
Do while (ors("lname") = lname and ors("fname")=fname)
Sum=Sum+ ors("wilwinpt")
ors.movenext
If ors.eof then
response.write sum
End if
loop
ors.moveprevious
response.write sum
%>
</td></tr>
<%
ors.movenext
loop
%>
</table>
<!--End of BELMONT Totals table-->
</td></tr>
</table>
<%
ors.close
set ors=nothing
oc.close
set oc=nothing %>
Enter your message below
Sign in or Join us (it's free).