What database are you using
You may be able to accomplish something using "WITH ROLLUP" but I am no
expert on that.
You may also be able to have the db return two result sets, one with data,
one with counts per group. That would depend on engine.
Otherwise I don't see any way to do it without making two passes through the
query, one to get cts, second time to display but that is ugly.
----- Original Message -----
From: "Jim McAtee" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Saturday, August 18, 2001 6:17 PM
Subject: Re: cfoutput group count
> What if you need to display the count _above_ the enumerated items?
>
> <cfoutput query="xx" group="xxxx">
> #xx.category# (#count# items)<br>
> <cfoutput>
> ....
> </cfoutput>
> </cfoutput>
>
>
>
> -----Original Message-----
> From: Don Vawter <[EMAIL PROTECTED]>
> To: CF-Talk <[EMAIL PROTECTED]>
> Date: Saturday, August 18, 2001 2:41 PM
> Subject: Re: cfoutput group count
>
>
> >Just initialize a counter before the group and increment it within the
> group
> >
> ><cfoutput query="xx' group="xxxx">
> > ....
> > <cfset ct=0>
> > <cfoutput>
> > ....
> > <cfset ct=ct+1>
> > </cfoutput>
> > The count for the group is #ct#
> > ...
> ></cfoutput>
> >
> >----- Original Message -----
> >From: "Eric J Hoffman" <[EMAIL PROTECTED]>
> >To: "CF-Talk" <[EMAIL PROTECTED]>
> >Sent: Saturday, August 18, 2001 1:43 PM
> >Subject: cfoutput group count
> >
> >
> >> I know this is easy, but I need sleep. How can I easily get the
> number
> >of
> >> records returned per grouping in a cfoutput query?
> >>
> >> Eric J Hoffman
> >> Small Dog Design, LLC
> >> www.smalldogdesign.com
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists