navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Count Records With Critera Help!

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Count Records With Critera Help!
Page: [1]
 
adamhum

 

Posts: 28
From: Tucson, Az, USA
Status: offline

 
Count Records With Critera Help! - 3/17/2001 20:59:00   
I use this custom SQL to count records in my database:
SELECT Count(Results.ID) AS ID FROM Results;

I would like to count all records in the status filed that says "Open" without passing the status from another web page form. like i do with this customer sql query results:

SELECT Count(results.ID) AS ID
FROM Results
WHERE status = '::status::'

How can I count all the records marked open in the status column without passing the criteria from another form web page?

Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Count Records With Critera Help! - 3/18/2001 18:22:00   
How do you get to that page and is it the result of a query too?

------------------
Spooky
"I am Spooky of Borg. Prepare to be assimilated, babycakes!"
Subscribe to OutFront News
Database / DRW Q & A
The Spooky Login!


(in reply to adamhum)
adamhum

 

Posts: 28
From: Tucson, Az, USA
Status: offline

 
RE: Count Records With Critera Help! - 3/19/2001 20:17:00   
This is a using the DRW then custom query..

(in reply to adamhum)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Count Records With Critera Help! - 3/19/2001 15:00:00   
From memory you can use :

<%=fp_iCount%>

Thats a count that is already performed for the displayed records.

------------------
Spooky
"I am Spooky of Borg. Prepare to be assimilated, babycakes!"
Subscribe to OutFront News
Database / DRW Q & A
The Spooky Login!


(in reply to adamhum)
adamhum

 

Posts: 28
From: Tucson, Az, USA
Status: offline

 
RE: Count Records With Critera Help! - 3/19/2001 16:30:00   
Where do I insert this is the custom query? How do I specify a certain value that I want to count within a column?

(in reply to adamhum)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Count Records With Critera Help! - 3/19/2001 19:05:00   
Ahh, sorry, misread the top note, that code returns all record count.

A bit of custom code may be needed.

Inside the DRW region and in html code view, do this:

<%
If FPFieldVal(fp_rs("Status")) = "Open" then
OpenCount = OpenCount + 1
End if
%>

At the bottom of your page where you want to display it, add this asp code (again in html code view)

<%=OpenCount %>


FPFieldVal(fp_rs("Status")) must be exactly the same as the code from your page that displays Status

------------------
Spooky
"I am Spooky of Borg. Prepare to be assimilated, babycakes!"
Subscribe to OutFront News
Database / DRW Q & A
The Spooky Login!


(in reply to adamhum)
adamhum

 

Posts: 28
From: Tucson, Az, USA
Status: offline

 
RE: Count Records With Critera Help! - 3/19/2001 21:33:00   
Can you explain what you mean by

"FPFieldVal(fp_rs("Status")) must be exactly the same as the code from your page that displays"


(in reply to adamhum)
KeithG

 

Posts: 92
From: Irving TX Irving, Texas, USA
Status: offline

 
RE: Count Records With Critera Help! - 3/19/2001 23:15:00   
adamhum:

This should work for you, it appears that you are using a custom query within a databse results region:

SELECT COUNT(results.ID) AS ID
FROM Results
WHERE status = ('Open')

Let me know if not, there are a couple of variations...


(in reply to adamhum)
adamhum

 

Posts: 28
From: Tucson, Az, USA
Status: offline

 
RE: Count Records With Critera Help! - 3/20/2001 20:20:00   
Thanks,
That worked perfectly!

(in reply to adamhum)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Count Records With Critera Help! - 3/20/2001 23:29:00   
The reason I mentioned the other way was so that you didnt need to resort to making another database call. Too many will quickly make Access fall over so be aware that another "count" may stress an already stressed database !

(in reply to adamhum)
KeithG

 

Posts: 92
From: Irving TX Irving, Texas, USA
Status: offline

 
RE: Count Records With Critera Help! - 3/20/2001 23:59:00   
Thats good advice Spooky, thanks.

(in reply to adamhum)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Count Records With Critera Help!
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts