Have an asp page that has two recordsets (detail & summary). I am trying to get subtotals to show up between changes in the unique record, something like this...
TRLRNUM BILLS WEIGHT
1234 2 500
1234 1 1000
SUBTOTAL 3 1500
7890 3 750
7890 2 250
SUBTOTAL 5 1000 etc...
The page i have now is close...the only problem is that it inserts the both subtotals after the first record, like this...
TRLRNUM BILLS WEIGHT
1234 2 500
SUBTOTAL 3 1500
SUBTOTAL 5 1000
1234 1 1000 etc...
Here is the problematic code...
<body>
<table width="850" height="100" border="1">
<tr>
<td colspan="12" bgcolor="#FFFF99"><strong>
LAX Inbound Linehauls - Previous Day </strong></td>
</tr>
<tr>
<td><div align="center"><strong>Trl
r Num </strong></div></td>
<td><div align="center"><strong>Rou
te</strong
></div></t
d>
<td><div align="center"><strong>Ori
g</strong>
</div></td
>
<td><div align="center"><strong>Des
t</strong>
</div></td
>
<td><div align="center"><strong>Dis
p Date</strong></div></td>
<td><div align="center"><strong>Dis
p Time </strong></div></td>
<td><div align="center"><strong>Sch
ed Arrv Date </strong></div></td>
<td><div align="center"><strong>Sch
ed Arrv Time </strong></div></td>
<td><div align="left"><strong>Shipp
ers</stron
g></div></
td>
<td><div align="center"><strong>Bil
ls</strong
></div></t
d>
<td><div align="center"><strong>Wei
ght</stron
g></div></
td>
<td><div align="center"><strong>TAF
Rev (incl. Fuel Schg) </strong></div></td>
</tr>
<% Do While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF)) %>
<% strThisRecord = (rs1.Fields.Item("TRLRNUM"
).Value) %>
<tr>
<td><%=(rs1.Fields.Item("T
RLRNUM").V
alue)%></t
d>
<td><%=(rs1.Fields.Item("R
OUTE").Val
ue)%></td>
<td><%=(rs1.Fields.Item("O
RIG").Valu
e)%></td>
<td><%=(rs1.Fields.Item("D
EST").Valu
e)%></td>
<td><%=(rs1.Fields.Item("D
ISPDAT").V
alue)%></t
d>
<td><%=(rs1.Fields.Item("D
ISPTIM").V
alue)%></t
d>
<td><%=(rs1.Fields.Item("S
ARVDAT").V
alue)%></t
d>
<td><%=(rs1.Fields.Item("M
HETAT").Va
lue)%></td
>
<td><%=(rs1.Fields.Item("S
HIPPERS").
Value)%></
td>
<td><%=(rs1.Fields.Item("B
ILLS").Val
ue)%></td>
<td><%= FormatNumber((rs1.Fields.I
tem("WEIGH
T").Value)
, 0, -2, -2, -2) %></td>
<td><%= FormatCurrency((rs1.Fields
.Item("TAF
REV").Valu
e), 2, -2, -2, -2)%></td>
</tr>
<% Do While ((Repeat2__numRows <> 0) AND (NOT rs2.EOF)) %>
<td colspan="8"><div align="right"><strong>Sub Totals </strong></div></td>
<td><%=(rs2.Fields.Item("T
RLRNUM").V
alue)%></t
d>
<td><%=(rs2.Fields.Item("B
ILLS").Val
ue)%></td>
<td><%= FormatNumber((rs2.Fields.I
tem("WEIGH
T").Value)
, 0, -2, -2, -2) %></td>
<td><%= FormatCurrency((rs2.Fields
.Item("TAF
REV").Valu
e), 2, -2, -2, -2)%></td>
</tr>
<%
rs2.MoveNext
Loop
%>
<%
rs1.MoveNext
Loop
%>
</table>
Thanks!
Start Free Trial