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

Searching for text in an index string 1

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,826
JP
Having a very stupid moment. I can't seem to figure out what seems obvious.

I have a table (CUSTOMER).
I have an index on CUSTOMER, so if set the index to CUSTNAME and then say:
SEEK "Some Company"
If would find "Some Company" if it matches.

But if it is actually "The Some Company", it won't find it.

I tried SEEK "Some" $ COMPANYNAME
But that fails.
Is there some way to find values within the name using SEEK? Is there some other command that I should be using.
A little surprisingly baffled here...

Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"I try to be nice, but sometimes my mouth doesn't cooperate.
 
Hi Mike,
WOW what a old age moment... LOCATE is the word I was looking for!
(And weird when I looked in the Fox Help file LOCATE wasn't a "See Also" for SEEK...)
Cheers my friend, you've helped me again.


Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"I try to be nice, but sometimes my mouth doesn't cooperate.
 
One small note: LOCATE can utilize an existing index if it fits the search expression.
Of course, in this case it didn't, and it never does with the $ operator.
 
Thanks Dan, I do understand that.
In this case this particular part of the database will never grow particularly large, and it's on an SSD so I am reasonably hopeful that performance will never be an issue. It it becomes one, then I'll drive it differently (SELECT on a GRID of results), but I needed something simple for now, and this did just the trick. It's only a little weird when you hit a result that you're not looking for and you just want the "next" one. I did this because I sometimes can't remember the full name of a company but I can remember some part of it, or in this case (that prompted me to do it) it was "The Company" and I didn't remember "the" in front of the name, and I was like AH! There it is! And overall this works really well, so I'm happy with it.

Hi Mike,
I have not had reason to push my application much from where it has been, but now I've a new service starting, and I'm interested in expanding what it can do, so you might see me around a little more often... ><
Hopefully answering more questions then I ask, but no promises. :)



Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"I try to be nice, but sometimes my mouth doesn't cooperate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top