Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Whole Word SQL Search Trouble
Message
 
À
23/10/1997 06:54:51
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00056125
Message ID:
00056286
Vues:
33
>>>>>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
>
>I was thinking about that on the way to work this morning, but thanks Barbara, you beat me to it.

Yes, I found that out right away when I looked more closely at Matt's idea...also, this is variable length (FORD just an example), so I have to PAD(LEN+1), but he got me thinking in the right direction past mental block :~) Thanks people...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform