I am using 'Like' in a sql query for a text field but not able get that to work. Here is what I am doing
SDescription = "'" & Text1.Text & " *'"
"SELECT * FROM TABLE WHERE DESCRIPTION LIKE " & SDescription
Printable View
I am using 'Like' in a sql query for a text field but not able get that to work. Here is what I am doing
SDescription = "'" & Text1.Text & " *'"
"SELECT * FROM TABLE WHERE DESCRIPTION LIKE " & SDescription
What Database Format are you using?
Access 97 and ADO. Does that matter?
The best way to do it is
SELECT * FROM TABLE WHERE DESCRIPTION LIKE '*" & text1.text & "'"
As far as I remember the wildcard for access is "*" if not use "%" which is the one for SQL Server
Don't forget that it will only work on words of the same case