Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another SQL question
Message
From
29/08/2002 08:49:37
 
 
To
28/08/2002 15:23:39
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00694233
Message ID:
00694876
Views:
12
This is a good idea, but in my special case I do not want to maintain separate fields in the table. This search also applies to other fields that the user can search for.

>would add a field to the table and fill this with strtran(upper(cName))
>and create an index on that field.
>
>Peter
>
>
>>>>Hello,
>>>>
>>>>I'm using this SQL statement:
>>>>
SELECT * from Test WHERE CHRTRAN(cName,' ','') = "GAMMARES"
>>>>
>>>>The result will also give records like "GAMMA". However, "GAMMA" = "GAMMARES" returns .F. Why does the result include these records?
>>>>Thanks.
>>>
>>>Christian,
>>>
>>>It has to do with how Fox compares strings. The rules are;
>>>...
>>>The ONLY way to get an exact comparison of two strings is to use the ==, SET EXACT ON does not give an exact comparison.
>>
>>Jim,
>>Thanks for the explanation. But then I still do not understand why the query includes matches for "GAMMA" when looking for "GAMMARES".
>>The result must be, whether EXACT is on or off:
>>
>>"GAMMA" = "GAMMARES" = .F.
>>
>>I do not want to have an exact match in the cursor. This is not the purpose. But if searching for "GAMMARES" the matches should include:
>>"GAMMA RESEARCH"
>>"GAMMARESEARCH"
>>"GAMMA RES"
>>"GAMMARES"
>>
>>The query should exclude:
>>"GAMMA"
>>"GAMMARE"
>>
>>How can I then accomplish that?
Christian Isberner
Software Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform