mcrmg
asked on
SQL query wildcard
Hi,
I am trying to create a form that only takes one string and pass it to a sp, but this parameter will look into several fields. This is my code, it works for only one field. Any ideas? thanks
I am trying to create a form that only takes one string and pass it to a sp, but this parameter will look into several fields. This is my code, it works for only one field. Any ideas? thanks
Select DISTINCT
F1, F2
From T1
Where
((@AnySearch is null) or (F1 LIKE '%' + @AnySearch + '%')) AND
((@AnySearch is null) or (F2 LIKE '%' + @AnySearch + '%'))
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER