I have code that works ok. It keeps a running total and displays it on the screen. the way i have the code set up though is it does not give me a running total for the last set of data.
My screen looks like this:
Health Care Group
|30 | 31-60 |61-90 |91-120 |120 | Net |
Total $1,428,512 $694,560 $326,272 $154,673 $451,112 3,055
Intellectual Property Group
30 |31-60 |61-90 |91-120| 120 |Net |
Total 1,655,587 1,737,393 533,269 363,6551, 976 146,266
Government Services Group
30 | 31-60 |61-90 |91-120 |120 |Net |
Under Government Services Group there should be a total like the first two.
My code:
do while not rs.eof
strDispName=rs("tsectdes"
locDesc= rs("ldesc"
dept=rs("tsectdes"
if not strFullName=strDispName then
if intTotPts1 > 0 or intTotPts2 >0 or intTotPts3 >0 or intTotPts4 >0 or intTotPts5 >0 or intTotPtsttl > 0 then
response.write "<tr bgcolor=" & rspaleyellow & "><td class=home2textB>Total</td>"
response.write "<td class=home2text>" & formatcurrency(intTotPts1,0)& "</td>"
response.write "<td class=home2text>" & formatcurrency(intTotPts2,0) & "</td>"
response.write "<td class=home2text>" & formatcurrency(intTotPts3,0) & "</td>"
response.write "<td class=home2text>" & formatcurrency(intTotPts4,0) & "</td>"
response.write "<td class=home2text>" & formatcurrency(intTotPts5,0) & "</td>"
response.write "<td class=home2text>" & formatcurrency(intTotPtsttl,0) & "</td>"
response.write "</tr>"
end if
intTotPts1=0
intTotPts2=0
intTotPts3=0
intTotPts4=0
intTotPts5=0
intTotPtsttl=0
end if
if Not strFullName=strDispName then
response.write "<table style=""border:solid " & tableborder & " 1px"" align=""center"" width=""95%"">"
response.write "<tr class=tablehead2><td class=home2textb colspan=7>" & dept & "</td>"
response.write "</tr>"
response.write "<tr class=tablehead>"
response.write "<th width=""25%"">Matter Resp Attorney/Matter</th>"
response.write "<th>30 Days of Less</th>"
response.write "<th>31-60 Days</th>"
response.write "<th>61-90 Days</th>"
response.write "<th>91-120 Days</th>"
response.write "<th>120 Days of More</th>"
response.write "<th>Net Outstanding</th>"
response.write "</tr>"
end if
if v=1 then
bgcolor=rsgreyll
v=0
else
bgcolor="#ffffff"
v=1
end if
'if Not strFullName=strDispName then
' response.write "<tr bgcolor=" & bgcolor & " class=home2text valign=top>"
' response.write "<td>" & rs("tsectdes" & "</td>"
' response.write "<td>" & formatcurrency(rs("one",0) & "</td>"
' response.write "<td>" & formatcurrency(rs("two",0) & "</td>"
' response.write "<td>" & formatcurrency(rs("three",0) & "</td>"
' response.write "<td>" & formatcurrency(rs("four",0) & "</td>"
' response.write "<td>" & formatcurrency(rs("five",0) & "</td>"
' response.write "<td>" & formatcurrency(rs("ttl",0) & "</td>"
' response.write "</tr>"
'end if
'running totals
intTotPts1=intTotPts1 + rs("one"
intTotPts2=intTotPts2 + rs("two"
intTotPts3=intTotPts3 + rs("three"
intTotPts4=intTotPts4 + rs("four"
intTotPts5=intTotPts5 + rs("five"
intTotPtsttl=intTotPtsttl + rs("ttl"
intSpace=1
intFirst=1
strTLoc=rs("tkloc"
strFullName=strDispName
rs.movenext
loop
Please help
thanks
joe cook
My screen looks like this:
Health Care Group
|30 | 31-60 |61-90 |91-120 |120 | Net |
Total $1,428,512 $694,560 $326,272 $154,673 $451,112 3,055
Intellectual Property Group
30 |31-60 |61-90 |91-120| 120 |Net |
Total 1,655,587 1,737,393 533,269 363,6551, 976 146,266
Government Services Group
30 | 31-60 |61-90 |91-120 |120 |Net |
Under Government Services Group there should be a total like the first two.
My code:
do while not rs.eof
strDispName=rs("tsectdes"
locDesc= rs("ldesc"
dept=rs("tsectdes"
if not strFullName=strDispName then
if intTotPts1 > 0 or intTotPts2 >0 or intTotPts3 >0 or intTotPts4 >0 or intTotPts5 >0 or intTotPtsttl > 0 then
response.write "<tr bgcolor=" & rspaleyellow & "><td class=home2textB>Total</td>"
response.write "<td class=home2text>" & formatcurrency(intTotPts1,0)& "</td>"
response.write "<td class=home2text>" & formatcurrency(intTotPts2,0) & "</td>"
response.write "<td class=home2text>" & formatcurrency(intTotPts3,0) & "</td>"
response.write "<td class=home2text>" & formatcurrency(intTotPts4,0) & "</td>"
response.write "<td class=home2text>" & formatcurrency(intTotPts5,0) & "</td>"
response.write "<td class=home2text>" & formatcurrency(intTotPtsttl,0) & "</td>"
response.write "</tr>"
end if
intTotPts1=0
intTotPts2=0
intTotPts3=0
intTotPts4=0
intTotPts5=0
intTotPtsttl=0
end if
if Not strFullName=strDispName then
response.write "<table style=""border:solid " & tableborder & " 1px"" align=""center"" width=""95%"">"
response.write "<tr class=tablehead2><td class=home2textb colspan=7>" & dept & "</td>"
response.write "</tr>"
response.write "<tr class=tablehead>"
response.write "<th width=""25%"">Matter Resp Attorney/Matter</th>"
response.write "<th>30 Days of Less</th>"
response.write "<th>31-60 Days</th>"
response.write "<th>61-90 Days</th>"
response.write "<th>91-120 Days</th>"
response.write "<th>120 Days of More</th>"
response.write "<th>Net Outstanding</th>"
response.write "</tr>"
end if
if v=1 then
bgcolor=rsgreyll
v=0
else
bgcolor="#ffffff"
v=1
end if
'if Not strFullName=strDispName then
' response.write "<tr bgcolor=" & bgcolor & " class=home2text valign=top>"
' response.write "<td>" & rs("tsectdes" & "</td>"
' response.write "<td>" & formatcurrency(rs("one",0) & "</td>"
' response.write "<td>" & formatcurrency(rs("two",0) & "</td>"
' response.write "<td>" & formatcurrency(rs("three",0) & "</td>"
' response.write "<td>" & formatcurrency(rs("four",0) & "</td>"
' response.write "<td>" & formatcurrency(rs("five",0) & "</td>"
' response.write "<td>" & formatcurrency(rs("ttl",0) & "</td>"
' response.write "</tr>"
'end if
'running totals
intTotPts1=intTotPts1 + rs("one"
intTotPts2=intTotPts2 + rs("two"
intTotPts3=intTotPts3 + rs("three"
intTotPts4=intTotPts4 + rs("four"
intTotPts5=intTotPts5 + rs("five"
intTotPtsttl=intTotPtsttl + rs("ttl"
intSpace=1
intFirst=1
strTLoc=rs("tkloc"
strFullName=strDispName
rs.movenext
loop
Please help
thanks
joe cook