|
| |
|
|
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!
|
|
|
|
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..
|
|
|
|
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!
|
|
|
|
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?
|
|
|
|
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!
|
|
|
|
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"
|
|
|
|
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...
|
|
|
|
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!
|
|
|
|
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.
|
|
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
|
|
|