I thought ASP Web Dev teacher should know ASP and SQL bec they got paid good money. Anyway, I changed the coding structure not to use response.write, instead use block so that its easy to read.
Here's what I came up:
<%
Dim username, total, mark
set rs=conn.execute("SELECT Predictions.[Match ID], Users.Username, Predictions.Week, Predictions.HPred, Predictions.APred, Predictions.Mark FROM Weeks INNER JOIN (Users INNER JOIN (Matches INNER JOIN Predictions ON Matches.[Match ID] = Predictions.[Match ID]) ON Users.Username = Predictions.User) ON (Weeks.Week = Predictions.Week) AND (Weeks.Week = Matches.Week) WHERE (((Predictions.Week)='" & week & "')) ORDER BY Users.Username, Predictions.[Match ID];")
rs.movefirst
total = 0
do until rs.eof
username = rs("username")
ttotal = total + ttotal
total= 0
%>
<%=username%>
<%
If rs("username") <> username or rs.eof Then
mark = rs("mark")
total = mark + total
end if
%>
<%
<%=rs("HPred")%> - <%=rs("APred")%>(<%=mark%>)
<%=total%>
<%
rs.movenext
loop
%>
<%
rs.close
Set rs = Nothing
%>
www.ex-designz.net
Dexter