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


Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 06-18-2003, 07:37 AM
2bNvUs's Avatar
2bNvUs 2bNvUs is offline
Centurion
 
Join Date: Apr 2003
Location: Birmingham, AL
Posts: 165
Default Counts/Averages/Sums from Columns/Rows

Is it giving you error messages or just the wrong answer to your equation?
__________________
I was just checkin' the...uh...specs on the..uh.. inline rotary..gu...I'm retarded. [I]-Chris Farley-Tommy Boy
Reply With Quote
  #3  
Old 06-18-2003, 09:16 AM
xamua xamua is offline
Centurion
 
Join Date: Dec 2002
Location: Here I am!
Posts: 184
Default

if you're handy with SQL you could probably do the sum(s) right in your database when you query it for your data...if i could see the SQL you're using now to pull the data out i could likely be more specific.
__________________
"Whom are you?" said he, for he had been to night school.
-- George Ade
"A long memory is the most subversive idea in America."
-- Unknown
Reply With Quote
Reply


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
 
 
-->