Hello guys, I'm having a problem when using the like operator in a specific way I need. I wonder if someone could help me out with this.
The problem is I require the SQL to search a specific part in a string and can't figure out how to do so.
String example:
str = "blablabla 16x1 blablabla"
So I've been using the operator being the string "6x1" and it works nicely.
"LIKE '*" & str & "*'"
My problem is that it returns me more registers than needed as it captures "6x1,5", 16x1" as well, for example.
As this is always followed by a blank space, I tried to use:
"LIKE '*" & Chr(32) & str & Chr(32) & "*'"
"LIKE '* " & str & " *'"
But it seems to not been detecting the blank space with any of this ways.
Any ideas how I could solve this to only get back the specific part right in between blank spaces that matches exacly the string typed?
Thanks in advance.
The problem is I require the SQL to search a specific part in a string and can't figure out how to do so.
String example:
str = "blablabla 16x1 blablabla"
So I've been using the operator being the string "6x1" and it works nicely.
"LIKE '*" & str & "*'"
My problem is that it returns me more registers than needed as it captures "6x1,5", 16x1" as well, for example.
As this is always followed by a blank space, I tried to use:
"LIKE '*" & Chr(32) & str & Chr(32) & "*'"
"LIKE '* " & str & " *'"
But it seems to not been detecting the blank space with any of this ways.
Any ideas how I could solve this to only get back the specific part right in between blank spaces that matches exacly the string typed?
Thanks in advance.