Solved

Count by Group

Posted on 2006-07-01
2
583 Views
Last Modified: 2013-12-24
 <cfoutput group="Disposition" query ="TimeFollowedMonths">
    <tr bgcolor="FFFFCC">
       <td>#Disposition#</td>
         <cfSet count = 1>
         <cfoutput>
             <cfif count NEQ 1>
                 </tr>
                 <tr>
                 <td>&nbsp;</td>
             </cfif>
      <td>
        <div align="right">#TheTimes#</div>
      </td>
      <td>
        <div align="center">#dateformat("#DateDischarged#", "mm/dd/yyyy")#</div>
      </td>
    </tr>
              <cfset count = count + 1>
      </cfoutput>         
  </cfoutput>
</table>

How do you put the count of each group at i.e. <td>#Disposition# (Count: 123)</td>, or at the bottom of each group?
0
Comment
Question by:ethanjohnsons
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 21

Accepted Solution

by:
pinaldave earned 500 total points
ID: 17030802
Soemthing like this:
<cfset dispositioncount = 0>
<cfoutput group="Disposition" query ="TimeFollowedMonths">
    <tr bgcolor="FFFFCC">
      <td>#Disposition#</td>
         <cfSet count = 1>
         <cfoutput>
             <cfif count NEQ 1>
                 </tr>
                 <tr>
                 <td>&nbsp;</td>
             </cfif>
      <td>
        <div align="right">#TheTimes#</div>
      </td>
      <td>
        <div align="center">#dateformat("#DateDischarged#", "mm/dd/yyyy")#</div>
      </td>
    </tr>
              <cfset count = count + 1>
<cfset dispositioncount = dispositioncount+1>
      </cfoutput>        
#dispositioncount#
  </cfoutput>
</table>

OR ------------------------------
You can use yourname.recordcount to display the recordcount.

Regards,
---Pinal
0
 

Author Comment

by:ethanjohnsons
ID: 17033266
great!
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question