Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 21st, 2004, 05:31 AM
Registered User
 
Join Date: Sep 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default counting record numbers in a loop

Hi,

I have a loop going through a recordset with a condition. If the condition is fullfilled then the record is displayed... and when the recordset has been fully paged iot stops so i am left with a list of values.... this all works fine.

The values field name is "email"

WHat i need to do now is to be able to count the records that have been displayed, or the count the records that have fullfilled the condition....... how can this be done please?



 
Old October 21st, 2004, 11:22 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hey sniffer,

You could just create a variable & increment it each time a record meets your requirements.

Cheers,

Chris

 
Old October 21st, 2004, 11:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Sniffer,

Is that in anyways related to your other post Can 2 recordsets be joined or searched?

If so, As Chris suggested, make the changes mentioned in RED below.

Code:
Dim iCnt
iCnt = 0
While NOT rs_A55report.EOF
    While NOT rs_special.EOF
        If rs_A55report("Email")= rs_special("Email_Address") then
            'Display the data from rs_A55report
            iCnt = iCnt + 1
        End If
        rs_special.MoveNext
    Loop
    rs_A55report.MoveNext
Loop
Response.write "Number of Records that matched the criteria : " & iCnt
Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem to fetch record using while loop Manoah Classic ASP Professional 9 July 31st, 2008 10:04 PM
XSLT loop counting and breaking. warhero XSLT 1 July 3rd, 2007 03:02 PM
Counting amount of record rtr1900 Classic ASP Databases 2 December 1st, 2005 08:08 AM
record counting keyvanjan Classic ASP Databases 0 June 30th, 2005 01:20 AM
Counting unique record dlamarche Access 5 March 22nd, 2005 08:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.