SQL query with multiple contains question.
I am trying to build a query where the end-user can search a field in the table for multiple keywords. I've tried several examples I found by searching SQL forums yet I keep getting Incorrect syntax near 'keyword*'. Does CF do it differently?
Something Like this....
<cfif isdefined("form.search1")>
<cfquery name="Messages" datasource="somedatasource">
Select *
From SomeTable
Where AffiliateID = #Session.AffiliateID# AND Contains(messagefile, '#Form.Search1#*')
<cfif isdefined("form.search2")>
AND Contains(messagefile, '#Form.Search2#*')
</cfif>
<cfif isdefined("form.search3")>
AND Contains(messagefile, '#Form.Search3#*')
</cfif>
Order by SomeField
</cfquery>
</cfif>
Greatly appreciate any help...
