> So I have a query that returns the following..
>
> Client_Code     MenuName     Client_Name
> 4938               Test           Test Company
> 9328               Test           Test Company
> 10349              Test           Test Company
> 9283               Test           Test 2 Company
>
> What I'm trying to do is produce a table for
>
> MenuName        Client_Name         Client_Code
> Test              Test Company       4938,9328,10349
> Test              Test 2 Company     9283
>
> So far, I have this..
>
>                 <cfoutput query="currentQuery" group="Client_Code">
>                         <tr>
>                         <cfloop list="#event.getArg("displayList")#" 
> index="currentField">
>                                 <td>
>                                         
> #currentQuery[currentField][currentQuery.currentRow]#
>                                 </td>
>                         </cfloop>
>                         </tr>
>                 </cfoutput>
>
> Which is showing each client_code on a seperate line..
>
> Can someone tell me what I'm doing wrong here?

Whenever you use the GROUP attribute of CFOUTPUT, you use a nested
CFOUTPUT to display the members of each group. So, you'd need
something like this:

<cfoutput query="..." group="Client_Name">
     <tr>
          <td>#MenuName#</td>
          <td>#Client_Name#</td>
          <td>
               <cfoutput>#Client_Code#,</cfoutput> <!--- this will
actually leave an extra comma at the end, there are various ways to
avoid that or remove it --->
          </td>
     </tr>
</cfoutput>

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352845
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to