Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Like operator - unexpected results 1

Status
Not open for further replies.

techsmith

MIS
Jun 27, 2003
114
GB
If I repeat the * wildcard more than once in my comparison string, LIKE always returns FALSE. Even simple comparisons like:

ABCABCABC LIKE *A*A* returns FALSE B-(

I can't find anything in the documentation to say this is standard behaviour and *str*str*str* type matches are essential in what we do.

Any clues, any alternatives?
 
The * is the Access wildcard, SQL Server and many others use %

Hope this helps.

[vampire][bat]
 
In VB(A) your statement works as you expect, but in .Net I can't make the Like operator work like that either, but altering the criterion to "A*A*" (i e removing the leading wildchard, makes this sample work. Interesting.

You might want investigate moving from "poor mans regex" to regex (System.Text.RegularExpressions Namespace).

Roy-Vidar
 
Thanks

Looks like LIKE is not fully supported in .NET, so I'll get my teeth into RegularExpressions - never came across these classes before. B-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top