M
montiy
I'm pulling data from a database, and performing calculations with that data
as it is inserted into a web page. I've got a number of calculations working
correctly; HOWEVER...I have this one pesky calculation that just is NOT
working. I've copied my code (below), if you can take a look...and you can
also check this page out live at http://www.ncsaa.org/stat_leaders_board.asp
(It's the calculation of Save Percentage, using the variables TotalSaves,
TotalGoals, and ShotsFaced, that is causing me problems.)
Thanks...Any help would be great!
-- Nate
---------------------------------
</table>
<p align="center" style="margin-top: 0; margin-bottom: 0">
</p>
<p align="center" style="margin-top: 0; margin-bottom: 0">
<font size="4" color="#0000FF"><b>SAVE PERCENTAGE
(KEEPER)</b></font></p>
<p align="center" style="margin-top: 0; margin-bottom: 0">
<font size="2" color="#0000FF"><b>(Minimum 60 shots
faced)</b></font></p>
<p align="center" style="margin-top: 0; margin-bottom: 0"> <table
width="100%" border="1">
<thead>
<tr>
<th><b>Last Name</b></th>
<th><b>First Name</b></th>
<th><b>Grade</b></th>
<th><b>School</b></th>
<th><b>Saves</b></th>
<th><b>Goals Allowed</b></th>
<th>Save Percentage</th>
</tr>
</thead>
<tbody>
<!--webbot bot="DatabaseRegionStart"
s-columnnames="ID,School,HS_Enrollment,Last_Name,First_Name,Grade,Games_Played,Shots_At_Goal,Goals_Scored,Assists,Goals_Allowed,Saves,Shutouts,Remote_computer_name,User_name,Browser_type,Timestamp"
s-columntypes="3,202,3,202,202,202,3,3,3,3,3,3,3,202,202,202,135"
s-dataconnection="stat_submission_form_soccer_boys" b-tableformat="TRUE"
b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE"
b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE"
b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource
s-displaycolumns="Last_Name,First_Name,Grade,School,Saves,Goals_Allowed"
s-criteria s-order s-sql="SELECT * FROM Results WHERE (Goals_Allowed + Saves
returned." i-maxrecords="20" i-groupsize="0" botid="20"
u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc"
u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td colspan=64
bgcolor="#FFFF00" width="100%"><font color="#000000">This is the start of a
Database Results region. The page must be fetched from a web server with a
web browser to display correctly; the current web is stored on your local
disk or network.</font></td></tr>" startspan --><!--#include
file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database
Results component on this page is unable to display database content. The
page must have a filename ending in '.asp', and the web must be hosted on a
server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Results WHERE (Goals_Allowed + Saves > 60) ORDER BY
(Saves / (Saves + Goals_Allowed)) DESC"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=6 align=""LEFT"" width=""100%"">No records
returned.</td></tr>"
fp_sDataConn="stat_submission_form_soccer_boys"
fp_iMaxRecords=20
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue="
fp_sColTypes="&ID=3&School=202&HS_Enrollment=3&Last_Name=202&First_Name=202&Grade=202&Games_Played=3&Shots_At_Goal=3&Goals_Scored=3&Assists=3&Goals_Allowed=3&Saves=3&Shutouts=3&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&"
fp_iDisplayCols=6
fp_fCustomQuery=True
BOTID=20
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="40941" --><tr>
<td align="center"><font size="2">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ID,School,HS_Enrollment,Last_Name,First_Name,Grade,Games_Played,Shots_At_Goal,Goals_Scored,Assists,Goals_Allowed,Saves,Shutouts,Remote_computer_name,User_name,Browser_type,Timestamp"
s-column="Last_Name" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>Last_Name<font size="-1">>></font>" startspan
--><%=FP_FieldVal(fp_rs,"Last_Name")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="17991" --></font></td>
<td align="center"><font size="2">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ID,School,HS_Enrollment,Last_Name,First_Name,Grade,Games_Played,Shots_At_Goal,Goals_Scored,Assists,Goals_Allowed,Saves,Shutouts,Remote_computer_name,User_name,Browser_type,Timestamp"
s-column="First_Name" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>First_Name<font size="-1">>></font>" startspan
--><%=FP_FieldVal(fp_rs,"First_Name")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="27645" --></font></td>
<td align="center"><font size="2">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ID,School,HS_Enrollment,Last_Name,First_Name,Grade,Games_Played,Shots_At_Goal,Goals_Scored,Assists,Goals_Allowed,Saves,Shutouts,Remote_computer_name,User_name,Browser_type,Timestamp"
s-column="Grade" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1"><<</font>Grade<font
size="-1">>></font>" startspan
--><%=FP_FieldVal(fp_rs,"Grade")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="9058" --></font></td>
<td align="center"><font size="2">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ID,School,HS_Enrollment,Last_Name,First_Name,Grade,Games_Played,Shots_At_Goal,Goals_Scored,Assists,Goals_Allowed,Saves,Shutouts,Remote_computer_name,User_name,Browser_type,Timestamp"
s-column="School" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1"><<</font>School<font
size="-1">>></font>" startspan
--><%=FP_FieldVal(fp_rs,"School")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="14919" --></font></td>
<td align="center"><font size="2">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ID,School,HS_Enrollment,Last_Name,First_Name,Grade,Games_Played,Shots_At_Goal,Goals_Scored,Assists,Goals_Allowed,Saves,Shutouts,Remote_computer_name,User_name,Browser_type,Timestamp"
s-column="Saves" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1"><<</font>Saves<font
size="-1">>></font>" startspan
--><%=FP_FieldVal(fp_rs,"Saves")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="7729" --></font></td>
<td align="center"><font size="2">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ID,School,HS_Enrollment,Last_Name,First_Name,Grade,Games_Played,Shots_At_Goal,Goals_Scored,Assists,Goals_Allowed,Saves,Shutouts,Remote_computer_name,User_name,Browser_type,Timestamp"
s-column="Goals_Allowed" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>Goals_Allowed<font size="-1">>></font>"
startspan --><%=FP_FieldVal(fp_rs,"Goals_Allowed")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="35843" --></font></td>
<td align="center"><font
size="2"> <%TotalGoals=FP_FieldVal(fp_rs,"Goals_Allowed")%><%TotalSaves=FP_FieldVal(fp_rs,"Saves")%><%ShotsFaced=TotalGoals+TotalSaves%><%If
ShotsFaced < 1 Then ShotsFaced = 1%><%=TotalSaves / ShotsFaced%></font></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE"
b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0"
clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00"
width="100%"><font color="#000000">This is the end of a Database Results
region.</font></td></tr>" startspan --><!--#include
file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></tbody>
as it is inserted into a web page. I've got a number of calculations working
correctly; HOWEVER...I have this one pesky calculation that just is NOT
working. I've copied my code (below), if you can take a look...and you can
also check this page out live at http://www.ncsaa.org/stat_leaders_board.asp
(It's the calculation of Save Percentage, using the variables TotalSaves,
TotalGoals, and ShotsFaced, that is causing me problems.)
Thanks...Any help would be great!
-- Nate
---------------------------------
</table>
<p align="center" style="margin-top: 0; margin-bottom: 0">
</p>
<p align="center" style="margin-top: 0; margin-bottom: 0">
<font size="4" color="#0000FF"><b>SAVE PERCENTAGE
(KEEPER)</b></font></p>
<p align="center" style="margin-top: 0; margin-bottom: 0">
<font size="2" color="#0000FF"><b>(Minimum 60 shots
faced)</b></font></p>
<p align="center" style="margin-top: 0; margin-bottom: 0"> <table
width="100%" border="1">
<thead>
<tr>
<th><b>Last Name</b></th>
<th><b>First Name</b></th>
<th><b>Grade</b></th>
<th><b>School</b></th>
<th><b>Saves</b></th>
<th><b>Goals Allowed</b></th>
<th>Save Percentage</th>
</tr>
</thead>
<tbody>
<!--webbot bot="DatabaseRegionStart"
s-columnnames="ID,School,HS_Enrollment,Last_Name,First_Name,Grade,Games_Played,Shots_At_Goal,Goals_Scored,Assists,Goals_Allowed,Saves,Shutouts,Remote_computer_name,User_name,Browser_type,Timestamp"
s-columntypes="3,202,3,202,202,202,3,3,3,3,3,3,3,202,202,202,135"
s-dataconnection="stat_submission_form_soccer_boys" b-tableformat="TRUE"
b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE"
b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE"
b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource
s-displaycolumns="Last_Name,First_Name,Grade,School,Saves,Goals_Allowed"
s-criteria s-order s-sql="SELECT * FROM Results WHERE (Goals_Allowed + Saves
clientside suggestedext="asp" s-defaultfields s-norecordsfound="No records60) ORDER BY (Saves / (Saves + Goals_Allowed)) DESC" b-procedure="FALSE"
returned." i-maxrecords="20" i-groupsize="0" botid="20"
u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc"
u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td colspan=64
bgcolor="#FFFF00" width="100%"><font color="#000000">This is the start of a
Database Results region. The page must be fetched from a web server with a
web browser to display correctly; the current web is stored on your local
disk or network.</font></td></tr>" startspan --><!--#include
file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database
Results component on this page is unable to display database content. The
page must have a filename ending in '.asp', and the web must be hosted on a
server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Results WHERE (Goals_Allowed + Saves > 60) ORDER BY
(Saves / (Saves + Goals_Allowed)) DESC"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=6 align=""LEFT"" width=""100%"">No records
returned.</td></tr>"
fp_sDataConn="stat_submission_form_soccer_boys"
fp_iMaxRecords=20
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue="
fp_sColTypes="&ID=3&School=202&HS_Enrollment=3&Last_Name=202&First_Name=202&Grade=202&Games_Played=3&Shots_At_Goal=3&Goals_Scored=3&Assists=3&Goals_Allowed=3&Saves=3&Shutouts=3&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&"
fp_iDisplayCols=6
fp_fCustomQuery=True
BOTID=20
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="40941" --><tr>
<td align="center"><font size="2">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ID,School,HS_Enrollment,Last_Name,First_Name,Grade,Games_Played,Shots_At_Goal,Goals_Scored,Assists,Goals_Allowed,Saves,Shutouts,Remote_computer_name,User_name,Browser_type,Timestamp"
s-column="Last_Name" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>Last_Name<font size="-1">>></font>" startspan
--><%=FP_FieldVal(fp_rs,"Last_Name")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="17991" --></font></td>
<td align="center"><font size="2">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ID,School,HS_Enrollment,Last_Name,First_Name,Grade,Games_Played,Shots_At_Goal,Goals_Scored,Assists,Goals_Allowed,Saves,Shutouts,Remote_computer_name,User_name,Browser_type,Timestamp"
s-column="First_Name" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>First_Name<font size="-1">>></font>" startspan
--><%=FP_FieldVal(fp_rs,"First_Name")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="27645" --></font></td>
<td align="center"><font size="2">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ID,School,HS_Enrollment,Last_Name,First_Name,Grade,Games_Played,Shots_At_Goal,Goals_Scored,Assists,Goals_Allowed,Saves,Shutouts,Remote_computer_name,User_name,Browser_type,Timestamp"
s-column="Grade" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1"><<</font>Grade<font
size="-1">>></font>" startspan
--><%=FP_FieldVal(fp_rs,"Grade")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="9058" --></font></td>
<td align="center"><font size="2">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ID,School,HS_Enrollment,Last_Name,First_Name,Grade,Games_Played,Shots_At_Goal,Goals_Scored,Assists,Goals_Allowed,Saves,Shutouts,Remote_computer_name,User_name,Browser_type,Timestamp"
s-column="School" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1"><<</font>School<font
size="-1">>></font>" startspan
--><%=FP_FieldVal(fp_rs,"School")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="14919" --></font></td>
<td align="center"><font size="2">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ID,School,HS_Enrollment,Last_Name,First_Name,Grade,Games_Played,Shots_At_Goal,Goals_Scored,Assists,Goals_Allowed,Saves,Shutouts,Remote_computer_name,User_name,Browser_type,Timestamp"
s-column="Saves" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1"><<</font>Saves<font
size="-1">>></font>" startspan
--><%=FP_FieldVal(fp_rs,"Saves")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="7729" --></font></td>
<td align="center"><font size="2">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="ID,School,HS_Enrollment,Last_Name,First_Name,Grade,Games_Played,Shots_At_Goal,Goals_Scored,Assists,Goals_Allowed,Saves,Shutouts,Remote_computer_name,User_name,Browser_type,Timestamp"
s-column="Goals_Allowed" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1"><<</font>Goals_Allowed<font size="-1">>></font>"
startspan --><%=FP_FieldVal(fp_rs,"Goals_Allowed")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="35843" --></font></td>
<td align="center"><font
size="2"> <%TotalGoals=FP_FieldVal(fp_rs,"Goals_Allowed")%><%TotalSaves=FP_FieldVal(fp_rs,"Saves")%><%ShotsFaced=TotalGoals+TotalSaves%><%If
ShotsFaced < 1 Then ShotsFaced = 1%><%=TotalSaves / ShotsFaced%></font></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE"
b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0"
clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00"
width="100%"><font color="#000000">This is the end of a Database Results
region.</font></td></tr>" startspan --><!--#include
file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></tbody>