Overflow Error
Please help, how can control the overflow eroor in the following
coding ?
Error Type:
Microsoft VBScript runtime (0x800A0006)
Overflow
/tabulation/bmhours/PWMH2.asp, line 226
coding
-------
Query is
---------
dim total11, total12, totalBH1 //all variables have defined.
ssql="select a.projno, e.Name, e.userid, e.dept,a.empno,b.dated,b.bh,sum(mh1) mh1 ,sum(MH2) MH2,sum(MH3) MH3,sum(MH4) MH4 ,sum(MH5) MH5 ,sum(total) total from (select empno ,projno ,mh1 = case when b.weekno = 1 then a.mh1 else 0 end ,MH2 = case when b.weekno = 2 then a.mh1 else 0 end ,MH3 = case when b.weekno = 3 then a.mh1 else 0 end ,MH4 = case when b.weekno = 4 then a.mh1 else 0 end ,mh5 = case when b.weekno = 5 then a.mh1 else 0 end ,total = a.mh1 from mh1 a JOIN weeks b ON a.dated = b.dated) a JOIN bh b ON a.empno = b.empno AND a.projno = b.projno JOIN Emp e ON a.empno = e.empno where b.dated='"& DATED &"' and a.projno='"& projno &"' group by a.projno ,e.dept,e.name,e.userid, a.empno,b.bh,b.dated order by e.DEPT,E.NAME,a.projno"
set rs=cn.Execute(ssql)
IF NOT RS.EOF THEN
do while rs.eof=false
Response.Write("<td align=center>" & rs("empno") & "</td>")
Response.Write("<td>" & rs("Name") & "</td>")
Response.Write("<td>" & rs("userid") & "</td>")
Response.Write("<td>" & rs("dept") & "</td>")
Response.Write("<td align=center>" & rs("BH") & "</td>")
totalBH1=rs("BH")
Response.Write("<td align=center>" & rs("mh1") & "</td>")
Response.Write("<td align=center>" & rs("mh2") & "</td>")
Response.Write("<td align=center>" & rs("mh3") & "</td>")
Response.Write("<td align=center>" & rs("mh4") & "</td>")
Response.Write("<td align=center>" & rs("mh5") & "</td>")
Response.Write("<td align=center>" & rs("total") & "</td>")
total11=rs("total")
Response.Write("<td>" & total11 & "</td>")
Response.Write("<td>" & totalBH1 & "</td>")
total12 = (total11/totalBH1)*100 // error is line no.226
Response.Write("<td>" & total12 & "</td>")
rs.movenext
loop
I want to calculate percentage in loop.
total12 = (total11/totalBH1)*100
total12 ie percentage of each row should be dipslay how ?
with sincere regards.
Mateen
|