Using wildcard characters in LIKE (VB/ASP.NET)

SELECT [field1], [field2], [field3] FROM [someDB] WHERE ([field1] LIKE @thisvariable)

thisvariable is assigned to a textbox on the form

If I enter %here%, it will give me all records where field1 contains 'here'. I can do other SQL wildcard things like %here and here%.

My question is, how can I put those wildcard characters into this select statement? Doing WHERE ([field1] LIKE '%@thisvariable%') doesn't work for me.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!