Use the like operator with the parameter
Hi
I want to use the Like operator. How is this done?
for example:
SELECT * FROM T1 WHERE Id LIKE N'%@ID%'
This code does not show anything
help me please, Thanks
I want to use the Like operator. How is this done?
for example:
SELECT * FROM T1 WHERE Id LIKE N'%@ID%'
This code does not show anything
help me please, Thanks
Comments
SELECT * FROM T1 WHERE Id LIKE '%' & @ID & '%'
note: msaccess database
Your code was correct and only needed a small change.
Instead of & should be + used.
SELECT * FROM T1 WHERE Id LIKE '%' + @ID + '%'