Pass wild card value to Where Like Statement.
-
I have the below query but would like to use a wild card value to do the search. I need to pass a value like "on" and find, Jason or Preston. It would be nick if it is also not case sensitive.... This value is coming from VB.Net App and this is messing with me... My Access (SQL) statement is: SELECT * FROM MainTB WHERE myCustomer Like [@myVar]; But the LIKE needs to be [%myVar%] I think. Feedback welcome please......
When people make you see red, be thankful your not colour blind.
-
I have the below query but would like to use a wild card value to do the search. I need to pass a value like "on" and find, Jason or Preston. It would be nick if it is also not case sensitive.... This value is coming from VB.Net App and this is messing with me... My Access (SQL) statement is: SELECT * FROM MainTB WHERE myCustomer Like [@myVar]; But the LIKE needs to be [%myVar%] I think. Feedback welcome please......
When people make you see red, be thankful your not colour blind.
-
Running this query from access it does not ask me for an input it is looking for a user of %myVar% As it is in the ' ' string quotes... I have already found this and tryed it... Any other thoughts..... ?
When people make you see red, be thankful your not colour blind.
-
I have the below query but would like to use a wild card value to do the search. I need to pass a value like "on" and find, Jason or Preston. It would be nick if it is also not case sensitive.... This value is coming from VB.Net App and this is messing with me... My Access (SQL) statement is: SELECT * FROM MainTB WHERE myCustomer Like [@myVar]; But the LIKE needs to be [%myVar%] I think. Feedback welcome please......
When people make you see red, be thankful your not colour blind.
The string concatenation character might help
select *
from MainTB
where upper(myCustomer) like '%'|upper(@myVar)|'%'This will also make it case insensitive.
Chris Meech I am Canadian. [heard in a local bar] Nobody likes jerks. [espeir] The zen of the soapbox is hard to attain...[Jörgen Sigvardsson] I wish I could remember what it was like to only have a short term memory.[David Kentley]