I'm using the following code to build and display a query string:\ <cfsavecontent variable="myquery"> Select * from contacts where 1 <cfif Form.company IS NOT "All">and company like '%<cfoutput>#Form.company#</cfoutput>%'</cfif> <cfif Form.title IS NOT "All">and title like '%<cfoutput>#Form.title#</cfoutput>%'</cfif> <cfif Form.city IS NOT "All">and city like '%<cfoutput>#Form.city#</cfoutput>%'</cfif> <cfif Form.state IS NOT "All">and state like '%<cfoutput>#Form.state#</cfoutput>%'</cfif> <cfif Form.country IS NOT "All">and country like '%<cfoutput>#Form.country#</cfoutput>%'</cfif> <cfif Form.type IS NOT "All">and type_of_industry like '%<cfoutput>#Form.type#</cfoutput>%'</cfif> <cfif Form.size IS NOT "All">and company_size <cfoutput>#Form.size#</cfoutput></cfif> <cfif Form.department IS NOT "All">and department like '%<cfoutput>#Form.department#</cfoutput>%'</cfif> <cfif Form.source IS NOT "All">and source_of_contact like '%<cfoutput>#Form.source#</cfoutput>%'</cfif> </cfsavecontent>
<cfoutput>#(myquery)# </cfoutput> The query string builds and displays correctly. For example: Select * from contacts where 1 and company like '%Company 1%' and title like '%Title 1%' and type_of_industry like '%Manufacturing%' and company_size <250 and department like '%Training%" However, when I try to save the query string in the database later it has a lot of unneeded spaces and line breaks like so: Select * from contacts where 1 and company like '%Company 1%' and title like '%Title 1%' and type_of_industry like '%Manufacturing%' and company_size <250 and department like '%Training%' Is there any way I can fix this? thanks, Luis ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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 Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4