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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Like, it's not finding it. 3

Status
Not open for further replies.

tlhawkins

Programmer
Joined
Dec 28, 2000
Messages
797
Location
US
Hey guys,

I have a search form that I want to be able to find parts of words.

If my field contains "California" I want "ca" to produce a hit.

I thought "Like" would do it but apparently no.
Is there anyway to use a real expression search with SQL?

Thanks in advance
 
[tt]Like% should do the trick
 
Like is not in VBScript. Use Instr.
lngInstr = Instr(1,strW,"ca",1) ' 1 for case insensitive.
if lngInstr > 0 then
...found
End If Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
johnYingling is correct. LIKE is not at ALL supported in VBscript as with many other comparison operators. This sounds like a good FAQ thread. check this thread for a example of using the Instr which is the way around using LIKE.
thread329-291077 I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
 
JohnYingling a star for pointing this comparison differnce in Vbscript and VB out. I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
 
This is very annoying! Why would like be unsupported?
What a frustrating problem!
Sera
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top