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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recordset count, available in ASP

Status
Not open for further replies.

ruupy

Programmer
Joined
Jan 12, 2001
Messages
29
Location
NL

I've seen a lot of neat count-queries but what if i want to extract the count-result from a simple query in an ASP page....???

Let's say that this :

count (DISTINCT PersNr) from EmpData


...a simple count of all records present (with a non-NULL value for PersNr).

How do i extract the outcome in ASP or do i need a different approach because i want to extract the outcome in ASP,...or do i need to post this question on an ASP-forum?...

RuupY
 
If you're using ADO then after you execute your query-
In javascript you can do this

If (MyRecordset.Eof = False)
{
MyVar = MyVariable.Fields('yourcolumnname').Value
}
I started out with nothing, and I still have most of it.
 
Code:
<%
var qCountEm = &quot;SELECT COUNT(DISTINCT PersNr) AS HowMany from EmpData&quot;;
rsCountEm.open(qCountEm, conn);

var how_many = rsCountEm(&quot;HowMany&quot;).value;
Response.write(&quot;The Number of distinct personnel numbers is: &quot; + how_many)
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top