Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Partial Record Count

Status
Not open for further replies.

toddsalcedo

Programmer
Jul 2, 2001
49
US
I have a table, fed from a database, that shows 29 items. I need to break that down further by splitting out the 29 items into different categories. The problem is that one of the items is multiple words and my count function breaks at that point. Here's the code:

<%
if RS("status") = "Resolution of Comments" then
do while RS("status") = "Resolution of Comments"
counter5=counter5+1
%>
<%RS.movenext
loop
end if
%>

There are 10 counter sections in all, all of them counting different rows of the table. Any ideas of a better way to try and count this?
 
If they are all based on the RS("status") field, then I would use a Select Case Statement. Something like this:
Code:
<%
Select Case RS("status")
  Case "Resolution of Comments"
    counter5 = counter5 + 1
  Case "Other Thing"
    counterOther = counterOther + 1
  Case Else
    'Do something here to handle anything that is outside your criteria
End Select

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top