Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another SQL question
Message
From
28/08/2002 10:05:42
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00694233
Message ID:
00694422
Views:
13
>>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
Next
Reply
Map
View

Click here to load this message in the networking platform