Probably a simple question, but...
A viewer selects a radiobox indicating "Exact Surname" or "Partial Surname". A variable called "SearchType" will then be assigned the value "=" or "LIKE"
My SQL code must then do a search using "=" or "LIKE' depending on which radiobox was selected.
I can't seem to modify my code so that this rather simple feature will work. Any help?
My existing code is:
<%
parts=Split(strSearch," ")
strSQL = " "& FieldSelect &" LIKE '%" &parts
& "%'"
for n=LBound(parts)+1 to UBound(parts)
strSQL = strSQL&" OR "& FieldSelect &" LIKE '%" &parts
&"%' "
next
strSQL = "SELECT * FROM TableName WHERE "&strSQL & " ORDER BY entry, sort;"
%>
A viewer selects a radiobox indicating "Exact Surname" or "Partial Surname". A variable called "SearchType" will then be assigned the value "=" or "LIKE"
My SQL code must then do a search using "=" or "LIKE' depending on which radiobox was selected.
I can't seem to modify my code so that this rather simple feature will work. Any help?
My existing code is:
<%
parts=Split(strSearch," ")
strSQL = " "& FieldSelect &" LIKE '%" &parts
for n=LBound(parts)+1 to UBound(parts)
strSQL = strSQL&" OR "& FieldSelect &" LIKE '%" &parts
next
strSQL = "SELECT * FROM TableName WHERE "&strSQL & " ORDER BY entry, sort;"
%>