View Single Post
 
Old June 6th, 2013, 08:01 PM
mat41 mat41 is offline
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Why is running two queries such an issue for you? It may not be possible to alter your query to sum the results. Post your query so we can at least look at it?

here is one option without running another query however that's is what I would do. run a quick select count(*) Where.......

BTW As I have done below, you should ALWAYS wrap an if not rsData.eof around every Do until rsData.eof

Code:
<% if not rsData.eof then
      dim theTotal
      do until rsdata.eof
         theTotal = theTotal + rs("SALES") 
         rsData.MoveNext 
      loop
      rsData.MoveFirst
      ressponse.write "<tr><td>Total</td><td>" & theTotal & "</td></tr>"
      rsData.MoveNext      
      do until rsData.EOF %>
         <tr>
           <td><%=rs("NAME")%></td>
           <td><%=rs("SALES")%></td>
         </tr>
<%       TTL_SALE = TTL_SALE + rs("SALES")
         rsData.MoveNext
      loop
      rsData.Close
   else
      response.write "<i>No data found</i>"
   end if
%>
__________________
Wind is your friend
Matt