\r\n\r\n
Go Back  Xtreme Visual Basic Talk > Other Languages > Web Programming > Counts/Averages/Sums from Columns/Rows


\r\n \r\n
 
 
Thread Tools Display Modes

\r\n\r\n\r\n
Hello. I have a slight problem. I am trying to take the following values from a table.
\r\n
\r\n<% if rs("wip") >0 then %>
\r\n<td align="middle" nowrap>
\r\n<small>
\r\n&nbsp;
\r\n<%= rs("wip")%>/<%= rs1("wordphrase")%>
\r\n&nbsp;&nbsp;
\r\n<font color=blue>
\r\n<%=round( rs("wip")/rs1("wordphrase")*100)%>%
\r\n</font>
\r\n</small>
\r\n</td>
\r\n<% else %>
\r\n<td align="middle" nowrap>
\r\n<small>
\r\n&nbsp;n/a&nbsp;&nbsp;
\r\n<font color=blue>
\r\n</font>
\r\n</small>
\r\n</td>
\r\n<% end if %>
\r\n
\r\nThe part in orange is what I need to sum then divide by the count of the rows displayed. I\'ve done stuff that works for other parts server side, the problem is that the data in the "wip"/"wordphrase" can change year to year. These are test results.
\r\n
\r\nFor example a wordphrase taken in 2000 might contain 6 total questions
\r\nbut in 2001 wordphrase might contain 8 total questions
\r\neither way 3/6 and 4/8 are still 50%, but I can\'t rely on counting the possible questions right-to-total questions because each year the data changes. This is why I\'m trying to figure out how to capture the round( rs("wip")/rs1("wordphrase")*100) data that is displayed and then add those up and divide by the total rows for that data that are displayed.
\r\n
\r\nIf there\'s a way to do it serverside I\'d rather do that, but for now clientside will be good enough. If you can at least point me in the right direction so that I can then understand this better I would greatly appreciate it, because later I have to further separate it by gender and race. Thanks.
\r\n \r\n\r\n
\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n Reply With Quote\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n'; pd[412407] = '\r\n\r\n \r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n
\r\n
\r\n  \r\n #2  \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n Old\r\n \r\n 06-18-2003, 07:37 AM\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
2bNvUs\'s Avatar\r\n\r\n
\r\n \r\n 2bNvUs\r\n 2bNvUs is offline\r\n\r\n\r\n
Prev Previous Post   Next Post Next
  #1  
Old 06-18-2003, 07:30 AM
arsaaved arsaaved is offline
Newcomer
 
Join Date: May 2003
Location: Sarasota, FL USA
Posts: 1
Unhappy Counts/Averages/Sums from Columns/Rows


Hello. I have a slight problem. I am trying to take the following values from a table.

<% if rs("wip") >0 then %>
<td align="middle" nowrap>
<small>
&nbsp;
<%= rs("wip")%>/<%= rs1("wordphrase")%>
&nbsp;&nbsp;
<font color=blue>
<%=round( rs("wip")/rs1("wordphrase")*100)%>%
</font>
</small>
</td>
<% else %>
<td align="middle" nowrap>
<small>
&nbsp;n/a&nbsp;&nbsp;
<font color=blue>
</font>
</small>
</td>
<% end if %>

The part in orange is what I need to sum then divide by the count of the rows displayed. I've done stuff that works for other parts server side, the problem is that the data in the "wip"/"wordphrase" can change year to year. These are test results.

For example a wordphrase taken in 2000 might contain 6 total questions
but in 2001 wordphrase might contain 8 total questions
either way 3/6 and 4/8 are still 50%, but I can't rely on counting the possible questions right-to-total questions because each year the data changes. This is why I'm trying to figure out how to capture the round( rs("wip")/rs1("wordphrase")*100) data that is displayed and then add those up and divide by the total rows for that data that are displayed.

If there's a way to do it serverside I'd rather do that, but for now clientside will be good enough. If you can at least point me in the right direction so that I can then understand this better I would greatly appreciate it, because later I have to further separate it by gender and race. Thanks.
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->