Click to See Complete Forum and Search --> : How to use 'Like' in a query..........


June 8th, 2000, 08:57 AM
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

Surrendermonkey
June 8th, 2000, 09:01 AM
What Database Format are you using?

June 8th, 2000, 09:11 AM
Access 97 and ADO. Does that matter?

TH1
June 8th, 2000, 09:16 AM
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