Peter, awesome, as you correctly pointed it out, the complex data type was the culprit, problem resolved.
Also, good catch on the function inside the loop, I've set up a flag to ensure it runs only once, so, that's ok; also initially thought the cf8 engine would run it only once but that could be totally wrong for expecting too much from cf8... Many thanks. Don >Don, the problem is that you are trying to output a complex object as a string. > >You need to do one of: >- use cfdump to have CF display your query as HTML; >- manually convert your query to a string; >- extract the appropriate fields and output those instead; >- change the function to return a string instead; > >Also note that you do not need/want to put the function inside the loop. > > >For example, I suspect this code is closer to what you want to do: >(note how the function returntype and cfreturn have changed) > ><cffunction name="getProduct" access="public" output="no" returnType="string"> > <cfargument name="id" type="numeric" required="yes"> > <cfset var data = ""> > <cfquery name="data" datasource="myDSN"> > SELECT pname > FROM product > where id= <cfqueryparam value="#Arguments.id#" > cfsqltype="cf_sql_integer"/> > </cfquery> > <cfreturn data.pname > > </cffunction> > ><cfoutput query="myQuery"> >... > <cfif conditionX eq 1> > #getProduct(3)# > </cfif> > ></cfoutput> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323371 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4