<CFSCRIPT>
// Assemble Search Queryif (NOT LEN(Keyword)) { Keyword = 'none'; } else { Keyword=
Replace(Keyword,"'","","ALL"); }
Delimiters = ' ,;:'; SearchName = ''; SearchDesc = '';
L = ListLen(Keyword, Delimiters);
for(k=1 ; k LTE L; k=k+1) {
SearchName = SearchName & "LOWER(p.description) LIKE
'%#LCase(ListGetAt(KeyWord,k,Delimiters))#%'";
SearchDesc = SearchDesc & "LOWER(p.details) LIKE
'%#LCase(ListGetAt(KeyWord,k,Delimiters))#%'";
if (k neq L) { SearchName = SearchName & ' AND ';
SearchDesc = SearchDesc & ' AND '; }
}
</CFSCRIPT>
<CFQUERY NAME="Product" DATASOURCE="#PrimaryDB#">
SELECT whatever
FROM product
WHERE ((#PreserveSingleQuotes(SearchName)#)
<CFIF IsDefined('Desc')>OR (#PreserveSingleQuotes(SearchDesc)#)</CFIF>)
</CFQUERY>
> Hi ppl..
> is there a built in function or wat in MSSQL to perform search query
> like Google..??
>
> for example.. i need to search for "Hello beautiful World"...
>
> how to write the query to search thru a column of a table
> where the return results can be...
>
> Beautiful Hello World
> World Helllo Beautiful
> Helllo World beautiful
>
>
> how to do it??
>
>
> han
>
>
______________________________________________________________________
Dedicated Windows 2000 Server
PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists