...

View Full Version : counting the records



havey
03-20-2006, 10:59 PM
Hi, in the asp script the email address get written for each value in the array like so:

For i = 0 To UBound(garrResult, 2)

Response.Write(garrResult(3, i))
Next

How could display a count of those where the email address equals something

thanks!

havey
03-21-2006, 02:29 AM
What i am trying to say is ...

i have an array below thats used to create a csv file, how can i use the elements in the array to give me a count where email address doesn't exist and fax does exist. I do not wish to use this number in the csv file but rather just display it on the page. Thanks

Response.Write("id")
Response.Write(",")
Response.Write("name")
Response.Write(",")
Response.Write("lastname")
Response.Write(",")
Response.Write("firstname")
Response.Write(",")
Response.Write("emailaddress")
Response.Write(",")
Response.Write("fax")
Response.Write(vbCrLf)

For i = 0 To UBound(garrResult, 2)
Response.Write(garrResult(0, i)) ' ID
Response.Write(",")
Response.Write( Replace(garrResult(1, i), ",", "") ) ' Last Name
Response.Write(",")
Response.Write( Replace(garrResult(2, i), ",", "") ) ' First Name
Response.Write(",")
Response.Write(garrResult(3, i)) ' E-mail
Response.Write(",")
Response.Write(garrResult(4, i)) ' Fax

Response.Write(vbCrLf)
Next

Archangel
03-21-2006, 02:12 PM
You could always add a value in your loop. On the outside dim your variable and then add it in the loop.

Dim myCount

For (blah blah)
If My criteria is met then
myCount = myCount + 1
Loop



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum