While there might even be a more graceful way to deal with this... Try maybe:

SELECT *
FROM table 
WHERE
<cfif form.state EQ "" AND form.zipcode EQ "" AND form.city="">
     1=0
<cfelse>
     <cfif #form.state# is not ""> table.state LIKE '#form.state#' AND </cfif>
     <cfif #form.zipcode# is not ""> table.zipcode LIKE '#form.zipcode#' 
AND</cfif>
     <cfif #form.city# is not ""> table.city LIKE '#form.city#' AND</cfif>
     0=0
</cfif>
</cfquery>


hopefully the indents look good!


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302947
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to