ok, now I'm getting an Overflow error (just one word, overflow) on the line near the bottom where I try to divide. here's my updated script
sql = "SELECT SUM(AwayPoint) AS totalaway FROM Score WHERE AwayID =" & vrec("CLId")
vrec2.Open sql, adoCon
sql = "SELECT SUM(HomePoint) AS totalhome FROM Score WHERE HomeID =" & vrec("CLId")
vrec1.Open sql, adoCon
totalh = vrec1("totalhome")
if IsNull(totalh) then totalh = 0 end if
totalh = CLng(totalh)
totala = vrec2("totalaway")
if IsNull(totala) then totala = 0 end if
totala = CLng(totala)
totalp = totalh + totala
vrec1.close
vrec2.Close
sql = "SELECT SUM(HomePoint) AS againsthome FROM Score WHERE AwayID =" & vrec("CLId")
vrec2.Open sql, adoCon
sql = "SELECT SUM(AwayPoint) AS againstaway FROM Score WHERE HomeID =" & vrec("CLId")
vrec1.Open sql, adoCon
againsth = vrec2("againsthome")
if IsNull(againsth) then againsth = 0 end if
againsth = CLng(totalh)
againsta = vrec1("againstaway")
if IsNull(againsta) then againsta = 0 end if
againsta = CLng(againsta)
againstp = againsth + againsta
againstp = CLng(againstp)
percent = totalh/againstp <-- overflow error here
percent = CLng(percent)
Edited by ub3rl337ch3ch - 27 February 2005 at 7:07pm