I am trying create a simple "Select" for exact match. I am trying:
'%" & strKeyword & "%' - Find all matches! Donīt work for me!
'%" strKeyword "%'
'" & strKeyword & "'
'" strKeyword "'
All above examples not works for find exact matches!
Could you help me?
Your select statement should look something like this.
"SELECT * FROM YourTable WHERE YourField LIKE '%" & strKeyword & "%'"
No. In this way It find all words that contains, for example "the", such as "whether".
From other hand if I use
"SELECT * FROM YourTable WHERE YourField = '%" & strKeyword & "%'"
it display nothing!
I don't think you can use the = sign and wildcards together. However you could try this.
SELECT * FROM YourTable WHERE YourField LIKE '% " & strKeyword & " %'"
This I believe would keep you from finding "whether". However the down side of this is that if your data has anything but spaces before or after your keyword than it won't return that record (i.e. the,).
Here's another post where me and some other people discussed a similar problem.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)