|
-
May 11th, 2005, 10:14 AM
#1
Thread Starter
Lively Member
filter expression for search string
whats a good filter expression for one up to 3 keywords.
if one keyword, it will be
NAME = '*keyword1*'
if 2 keyword, it will be
NAME = '*keyword1*' OR NAME = '*keyword2*'
if 3 keyword, it will be
NAME = '*keyword1*' OR NAME = '*keyword2*' OR NAME = '*keyword3*'
problem is how do i know if its 1 or 2 or 3 keyword entered in a search string
-
May 11th, 2005, 11:16 AM
#2
Thread Starter
Lively Member
Re: filter expression for search string
-
May 11th, 2005, 11:27 AM
#3
Lively Member
Re: filter expression for search string
This is definately not an expert answer hehe. But this may help get you on track.
Code:
Private Function GetFilterString(ByVal SearchString as String) As String
Dim strSearchWords as String()
Dim Filter as String
strSearchWords = SearchString.Split(New [Char]() {" "})
For i as Integer = 0 to strSearchWords.Length() - 1
If Filter <> "" Then
Filter &= " OR "
End If
Filter &= "NAME = '*" & strSearchWords(i) & "*'"
Next
Return Filter
End Function
-
May 11th, 2005, 11:31 AM
#4
Lively Member
Re: filter expression for search string
If you are specifically looking for the number, then just return the .length in the code that I posted.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|