Advertisement

10.19.2005 at 11:17PM PDT, ID: 21601327
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.8

Insert subtotal between change in unique keys

Asked by MilburnDrysdale in Active Server Pages (ASP)

Tags: ,

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>Trlr Num </strong></div></td>
    <td><div align="center"><strong>Route</strong></div></td>
    <td><div align="center"><strong>Orig</strong></div></td>
    <td><div align="center"><strong>Dest</strong></div></td>
    <td><div align="center"><strong>Disp Date</strong></div></td>
    <td><div align="center"><strong>Disp Time </strong></div></td>
    <td><div align="center"><strong>Sched Arrv Date </strong></div></td>
    <td><div align="center"><strong>Sched Arrv Time </strong></div></td>
    <td><div align="left"><strong>Shippers</strong></div></td>
    <td><div align="center"><strong>Bills</strong></div></td>
    <td><div align="center"><strong>Weight</strong></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("TRLRNUM").Value)%></td>
       <td><%=(rs1.Fields.Item("ROUTE").Value)%></td>
       <td><%=(rs1.Fields.Item("ORIG").Value)%></td>
       <td><%=(rs1.Fields.Item("DEST").Value)%></td>
       <td><%=(rs1.Fields.Item("DISPDAT").Value)%></td>
       <td><%=(rs1.Fields.Item("DISPTIM").Value)%></td>
       <td><%=(rs1.Fields.Item("SARVDAT").Value)%></td>
       <td><%=(rs1.Fields.Item("MHETAT").Value)%></td>
       <td><%=(rs1.Fields.Item("SHIPPERS").Value)%></td>
       <td><%=(rs1.Fields.Item("BILLS").Value)%></td>
       <td><%= FormatNumber((rs1.Fields.Item("WEIGHT").Value), 0, -2, -2, -2) %></td>
       <td><%= FormatCurrency((rs1.Fields.Item("TAFREV").Value), 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("TRLRNUM").Value)%></td>
         <td><%=(rs2.Fields.Item("BILLS").Value)%></td>
       <td><%= FormatNumber((rs2.Fields.Item("WEIGHT").Value), 0, -2, -2, -2) %></td>
       <td><%= FormatCurrency((rs2.Fields.Item("TAFREV").Value), 2, -2, -2, -2)%></td>
     </tr>
             <%
      rs2.MoveNext
  Loop
%>
             <%
      rs1.MoveNext
  Loop
%>
   
</table>


Thanks!Start Free Trial
 
Loading Advertisement...
 
[+][-]10.20.2005 at 12:20AM PDT, ID: 15122249

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.20.2005 at 08:06AM PDT, ID: 15125045

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.20.2005 at 08:20AM PDT, ID: 15125215

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.20.2005 at 08:22AM PDT, ID: 15125245

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.20.2005 at 08:37AM PDT, ID: 15125412

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.20.2005 at 09:18AM PDT, ID: 15125780

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.20.2005 at 01:22PM PDT, ID: 15128079

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.20.2005 at 04:14PM PDT, ID: 15129318

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: asp, subtotal
Sign Up Now!
Solution Provided By: Connick007
Participating Experts: 1
Solution Grade: A
 
 
[+][-]10.20.2005 at 07:40PM PDT, ID: 15130167

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.20.2005 at 10:33PM PDT, ID: 15130583

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32