Game Results Team Stats Individual Stats Home Roster & Schedule Pictures Driving Directions

Season Stats for all games
Click on the column header to sort by category <% ' this code opens the database myDSN="DSN=renegades" set conntemp=server.createobject("adodb.connection") conntemp.open myDSN Dim player_name(26) Dim ab(26) Dim h(26) Dim r(26) Dim rbi(26) Dim hr(26) Dim triples(26) Dim doubles(26) Dim subplayer(26) Dim avg(26) Dim sorttmp(26) sort_var=request.querystring("sortvar") sort_var_tmp=request.querystring("sortvartmp") desc_var=request.querystring("descvar") if sort_var <> "avg" and sort_var <> "" then if sort_var <> "name" then qsort_var = "sum(" & sort_var & ")" else qsort_var = "player_name" end if else qsort_var = "avg(h)/avg(ab)" end if if sort_var_tmp = sort_var and sort_var_tmp <> "" then if desc_var = "desc" then qdesc_var = "asc" desc_var = "asc" else qdesc_var = "desc" desc_var = "desc" end if else if sort_var <> "name" then qdesc_var = "desc" desc_var = "desc" else qdesc_var = "asc" desc_var = "asc" end if end if sort_var_tmp = sort_var mySQL="select player_name,sum(ab) as abx,sum(h) as hx,sum(r) as rx,sum(rbi) as rbix,sum(hr) as hrx,sum(triples) as triplesx,sum(doubles) as doublesx,avg(h)/avg(ab) as avgx from box_scores GROUP BY player_name ORDER BY " & qsort_var & " " & qdesc_var & "" set rstemp=conntemp.execute(mySQL) ' this code detects if data is empty If rstemp.eof then response.write "No records matched
" response.write mySQL & "
So cannot make table..." rstemp.close set rstemp=nothing response.end end if DO UNTIL rstemp.eof player_name(indstat)=rstemp("player_name") ab(indstat)=rstemp("abx") h(indstat)=rstemp("hx") r(indstat)=rstemp("rx") rbi(indstat)=rstemp("rbix") hr(indstat)=rstemp("hrx") triples(indstat)=rstemp("triplesx") doubles(indstat)=rstemp("doublesx") avg(indstat)=rstemp("avgx") totab = totab + ab(indstat) toth = toth + h(indstat) totr = totr + r(indstat) totrbi = totrbi + rbi(indstat) tothr = tothr + hr(indstat) tottriples = tottriples + triples(indstat) totdoubles = totdoubles + doubles(indstat) rstemp.movenext indstat = indstat + 1 LOOP totavg = toth/totab response.write"" response.write"" response.write"" response.write"" response.write"" response.write"" response.write"" response.write"" response.write"" response.write"" response.write"" response.write"" For x = 0 to indstat-1 if ab(x) <> 0 then avg(x) = (h(x)/ab(x)) ' write the fields to browser cellstart="" response.write "" response.write cellstart & formatnumber(avg(x),3,0) & "" response.write cellstart & ab(x) & "" response.write cellstart & h(x) & "" response.write cellstart & r(x) & "" response.write cellstart & rbi(x) & "" response.write cellstart & hr(x) & "" response.write cellstart & triples(x) & "" response.write cellstart & doubles(x) & "" response.write "" end if next cellstart="" response.write "" response.write cellstart & formatnumber(totavg,3,0) & "" response.write cellstart & totab & "" response.write cellstart & toth & "" response.write cellstart & totr & "" response.write cellstart & totrbi & "" response.write cellstart & tothr & "" response.write cellstart & tottriples & "" response.write cellstart & totdoubles & "" response.write "" %>
PlayerAvgABHRRBIHR3B2B
" response.write "
" & player_name(x) & "
" response.write "
Totals
<% ' Now close and dispose of resources rstemp.close set rstemp=nothing conntemp.close set conntemp=nothing %>