Howdy, Stranger!

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

Categories

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

paulmorrisonpaulmorrison Member Posts: 127
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.

Comments

Sign In or Register to comment.