Victor Charles
asked on
Help with partial string search using Substring
Hi,
How do you modify the Substring below which searches for the first three characters in a field to search for part of the data in a data field,
For example if the field contains 9999-00-999-9999 Ho do I search only for 00, considering xyz '''00'".
Dim SearchCriteria as String = "Substring(SN, 1,3) IN ('" & xyz &"')
Thanks,
Victor
How do you modify the Substring below which searches for the first three characters in a field to search for part of the data in a data field,
For example if the field contains 9999-00-999-9999 Ho do I search only for 00, considering xyz '''00'".
Dim SearchCriteria as String = "Substring(SN, 1,3) IN ('" & xyz &"')
Thanks,
Victor
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank You for both answers, I will get back to you.
Victor
Victor
ASKER
Hi,
I was able to solve the issue withthe code below.
Dim SearchCriteria as String = "SN LIKE '%" & xyz &"%'"
Thanks,
Victor
I was able to solve the issue withthe code below.
Dim SearchCriteria as String = "SN LIKE '%" & xyz &"%'"
Thanks,
Victor
ASKER
Thank You.
9999-00-999-9999
You want to search against the 6-7th characters instead of the 1-3rd characters, right?
Dim SearchCriteria as String = "Substring(SN, 6,2) IN ('" & xyz &"')