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

Calculating a Total From A MDB Table

Status
Not open for further replies.

mx3com

Technical User
Oct 29, 2000
9
CA
How would I go about Calculating the number of records which have a Check box checked in a table using CF?

Basically what I am after is a total of the completed entries in the Table.

For Example:
50 Records listed in the table, 30 of them have a check box field checked to say they are completed. I need to display the number 30 as a result, which I should be able to change into a percenetage (60%) easily enough. Possibly later on even taking these results as far as showing a graph or chart for percent completed?

Any advice is greatly appreciated. Thanks in advance.

Jeff Aycan - mx-3@home.com - Webmaster, MX-3.com

 
Hi Jeff,

Will this work for you? You'll just need to substitute your table and field names.

<cfquery name=&quot;q1&quot; datasource=&quot;myDatasource&quot;>
select from table1 where checkField = 1
</cfquery>

<cfoutput>#q1.recordcount#</cfoutput> records are checked.

GJ
 
I should have known that one! (I've used the record count statement before.)
It worked, Thanks!

Jeff Aycan - mx-3@home.com - Webmaster, MX-3.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top