Skip to main content
Known Participant
May 4, 2007
Answered

group function in coldfusion

  • May 4, 2007
  • 1 reply
  • 248 views
Hello does anyone know how to use the group function in coldfusion
my tables that out-puts to a html
is outputing multiple CEENO

for example CEENO
11111
11111
11111
11111

someone here said to use the group function in coldfusion
do you know where i can put it?




<table border="2" cellpadding="2" cellspacing="0">
<tr>
<th>Record Number</th>
<TH>PEA_id</TH>
<th width="120">CEENO</th>
<TH>Address</TH>

<TH>ZipCode</TH>

<th>AdvisoryDate</th>






</tr>

<cfloop query="getthecases">


<tr bgcolor="<cfif currentrow mod 2>GHOSTWHITE<cfelse>WHITE</cfif>">
<td>#CurrentRow#</td>
<td>#PEA_id</td>
<Td>#CEENO#</td>
<td>#ST_NO# #ST_initial# #st_dir#</td>
<td>#ZipCode#</td>





<td>#dateformat(ADVISORY_DATE,"mm/dd/yyyy")#</td>









</tr>
</cfloop>

</table>
This topic has been closed for replies.
Correct answer DDewbre
Try this:

<cfoutput query ="getthecases" group="INSERT DB FIELD YOU WANT OUTPUT GROUPED BY">

<tr bgcolor="<cfif currentrow mod 2>GHOSTWHITE<cfelse>WHITE</cfif>">
<td>#CurrentRow#</td>
<td>#PEA_id</td>
<Td>#CEENO#</td>
<td>#ST_NO# #ST_initial# #st_dir#</td>
<td>#ZipCode#</td>
<td>#dateformat(ADVISORY_DATE,"mm/dd/yyyy")#</td>

</cfoutput>

1 reply

DDewbreCorrect answer
Inspiring
May 7, 2007
Try this:

<cfoutput query ="getthecases" group="INSERT DB FIELD YOU WANT OUTPUT GROUPED BY">

<tr bgcolor="<cfif currentrow mod 2>GHOSTWHITE<cfelse>WHITE</cfif>">
<td>#CurrentRow#</td>
<td>#PEA_id</td>
<Td>#CEENO#</td>
<td>#ST_NO# #ST_initial# #st_dir#</td>
<td>#ZipCode#</td>
<td>#dateformat(ADVISORY_DATE,"mm/dd/yyyy")#</td>

</cfoutput>