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

Counting output records/rows that have been grouped

Status
Not open for further replies.

rosn459

Programmer
Sep 18, 2003
37
US
I need to include sequential record numbers in my cfoutput for data that has been grouped according to my customer's requirements.

How would I do this with CF?

<cfoutput>
(Ex:
Area One
1 Name1 HireDate1 Address1
2 Name2 HireDate2 Address2
Area Two
1 Name1 HireDate1 Address1
2 Name2 HireDate2 Address2
</cfoutput>
 
Set a counter. Use the GROUP attribute of CFOUTPUT to display information by area. Increment the counter within the sub-CFOUTPUT section.

Phil Hegedusich
Senior Web Developer
IIMAK
-----------
Boy howdy, my Liberal Studies degree really prepared me for this....
 
Back with a bit more detail.


<cfoutput query="myquery" group="area">

#Area#
<cfset counter=0>
<cfoutput>
<cfset counter=counter+1>
#counter# #name# #hiredate# #address#<br>
</cfoutput>
</cfoutput>

HTH,

Phil Hegedusich
Senior Web Developer
IIMAK
-----------
Boy howdy, my Liberal Studies degree really prepared me for this....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top