You could do it on the SQL side with a custom field. At least you would be offloading the heavy lifting to SQL. Not sure if it makes sense to tackle it this way, but just I tested this and it works...
<cfquery name="testQuery" datasource="testdb"> SELECT dbo.test.organization, dbo.test.address, dbo.test.phone, dbo.test.contactPerson, CASE WHEN ( dbo.test.email ) IS NULL THEN dbo.test.organization ELSE '<a href="mailto:' + dbo.test.email + '">' + dbo.test.organization + '</a>' END as contactString FROM dbo.test </cfquery> <cfoutput query="testQuery"> #testQuery.contactString# - #testQuery.Organization# - #testQuery.Address# - #testQuery.Phone# - #testQuery.contactPerson#<br><br> </cfoutput> ________________________________________________________________ Jeff Langevin Appalachian Mountain Club MIS Department 5 Joy Street, Boston, Massachusetts 02108 When you do the common things in life in an uncommon way, you will command the attention of the world. --George Washington Carver ____________________Reply Separator____________________ Subject: efficient solution, problems with Author: [EMAIL PROTECTED] Date: 6/13/2003 12:28 PM I have a list of organizations, their email, address, phone, contact person etc... The displayed table is as follows: Organization - Address - Phone - Contact Person <a href="mailto:#email#">Organization Name</a> - #address# - #phone# - #contactPerson# Now, things became a little more complicated. Some organizations have more than one contact person and we want to have their names link to their personal email. Here's the issue, some people have email accounts, others don't -- incredible isn't it that some people still don't have email? :-} Anyway what I would like is for those that have email accounts to have their names linked and for those that don't have email accounts to remain unlinked. There are hundreds of names so I don't want to do a <cfif> on each .... err I mean <cfswitch>. Two querries could be done, one with names with email and one without but would it be more efficient than 100s of <cfswitch>? Not to mention that I'm not too sure on how I would be able to display the querried solution. Each column name is linked allowing users to order (ASC & DESC) by that column. thx. Gilbert Midonnet ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4