PDA

Click to See Complete Forum and Search --> : Count(*)


joey o.
Oct 15th, 2000, 04:55 PM
Hi I need the count of the recordset and need help.Here's the idea:

<html><head><title></title></Head><body>
<H3>There are this many rows with this criteria: <b>open</b>.</H3>
<%
Dim Connect, Query
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "NewSite"
Set Query = Connect.Execute ("Select COUNT(*) from Tracking where (Status1 = 'In Progress') or (Status1 = 'Delayed')")
%>
count=Query.(WHAT GOES HERE?)
Query.Close
set Query = nothing
Connect.Close
set Connect = nothing
%>
</body></html>

Oct 16th, 2000, 01:55 AM
Why not change the query string to this:

Select count(*) AS MyCount from Tracking where (Status1 = 'In Progress') or (Status1 = 'Delayed')


And then later on, you can get the value like this:

Count = Query.fields.item("MyCount").value