> I am getting users names from one table and joining the years > they have been with us in another. How would I join the two > together and ouput the years (1995,1996,1997) along with their name. > > Here are the tables:
Use a standard JOIN, but don't use just a CFLOOP or CFOUTPUT, instead using GROUP; <CFOUTPUT QUERY="myQuery" GROUP="ID"> <tr> <td>#first_name# #last_name#</td> <td>Years: <CFSET firstEntry="Yes"> <CFOUTPUT> <CFIF firstEntry> , </CFIF> <CFSET firstEntry="No"> #Year# </CFOUTPUT> </td> </tr> </CFOUTPUT> In case you're wondering, the "firstEntry" is so we don't have extra commas HTH Philip Arnold Technical Director Certified ColdFusion Developer ASP Multimedia Limited Switchboard: +44 (0)20 8680 8099 Fax: +44 (0)20 8686 7911 www.aspmedia.co.uk www.aspevents.net An ISO9001 registered company. ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ********************************************************************** ______________________________________________________________________ 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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists