Solved

Count by Group

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IIS url rewrite rule for web application 3 65
JVM encoding. How to change encoding. 27 121
Internal to DMZ IIS Authentication. 3 65
Company website 6 50
In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …

730 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