Forums
This topic is locked
multisearch
30 Jul 2002 13:53:21 Garo Maka posted:
I got a multisearch string atached to the recordset sql, I want it to filter through the 3 selects and the txtKeywords. Works fine except for...... the textfield, it searches in 3 table fields. With OR it will not filter through the other 3 strings. With AND all the table fields will have to contain the keyword.
Any sugestions of how this txtkeyword can be filtered through the 3 selects?
Right now it looks like this:
<%
varWhereString = "WHERE BEHANDLER_ID <> -1 "
IF Request("selCat"

AndCatString = " AND KATEGORI LIKE '%" & Request("selCat"

Else
AndCatString = ""
End If
IF Request("selAmt"

AndAmtString = " AND AMT LIKE '%" & Request("selAmt"

Else
AndAmtString = ""
End If
IF Request("selKommune"

AndCityString = " AND CITY LIKE '%" & Request("selKommune"

Else
AndCityString = ""
End If
<font color=green>
IF Request("txtKeywords"

AndtxtKeywordsString = " AND FIRMANAVN LIKE '%" & Request("txtKeywords"



Else
AndtxtKeywordsString = ""
End If
</font id=green>
varWhereString = varWhereString & AndCatString & AndAmtString & AndCityString & AndtxtKeywordsString & " ORDER BY BEHANDLER_ID ASC"
%>
Replies
Replied 31 Jul 2002 11:28:52
31 Jul 2002 11:28:52 Vince Baker replied:
you need to use brackets around the or values...
(field LIKE 'this' OR 2ndfield LIKE 'that') AND 3rdfield = 'the other'
(field LIKE 'this' OR 2ndfield LIKE 'that') AND 3rdfield = 'the other'