Solved

Count by Group

Posted on 2006-07-01
2
579 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
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

810 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