Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Whole Word SQL Search Trouble
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00056125
Message ID:
00056224
Views:
26
>>>I'm trying to do an SQL that searches for whole words only, using the '%'...
>>>myfield LIKE "% FORD%" OR
>>>myfield LIKE "% FORD %" OR
>>>myfield LIKE "%FORD "...which correctly gets
>>>
>>>FORD MOTORS
>>>DIXON FORD
>>>BIG FORD CO
>>>
>>>but also BUFORD TIRES and CITY OF FORDHAM, which I don't want.
>>>
>>>Any ideas on how to do this? Or a better technique?
>>
>>LEFT(myfield,4) = "FORD" OR ;
>>RIGHT(myfield,4) = "FORD" OR ;
>>" FORD "$myfield
>
>Thanks...that's what I needed, a fresh perspective.

Actually, I think you'll have to have
LEFT(myfield,5) = "FORD " OR ;
RIGHT(myfield,5) = " FORD" OR ;
" FORD "$myfield
or you'll include Fordham City and City of Buford.

Barbara
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform