Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple select that doesn't work..
Message
From
01/12/2006 02:34:38
 
 
To
30/11/2006 18:37:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01173935
Message ID:
01174016
Views:
10
>Now I'm lost. :(
>
>Why is it that R, R1, R2 is selected when I do "select * from table where ckey="R".. ")
>
>???

I see that Cetin gave you the solution, but you should read this excerpt from Help, or you will surely get into similar situations later.

Visual FoxPro has two relational operators that test for equality: the equal sign (=) operator and the double equal sign (==) operator. You can use the = operator to perform a comparison between two values of the same type and is suitable for comparing data of Character, Numeric, Date, and Logical type. However, when you compare character expressions with the = operator, the results might not exactly as expected.

Character expressions are compared character for character from left to right until one of the expressions does not equal the other or until the end of the expression on the right of the = operator is reached, as specified by setting the SET EXACT command to OFF, or until the ends of both expressions are reached, as specified by setting the SET EXACT command to ON.

You can use the == operator to perform an exact comparison of character or binary data. If you compare two character or binary expressions using the == operator, the expressions on both sides of the == operator must contain precisely the same characters or bytes, including spaces or zero (0) bytes, respectively, to be considered equal. The SET EXACT setting is ignored when character strings or binary expressions are compared using the == operator. For more information, see Relational Operators.


In VFP9, you will find this under String and Value Comparison in Visual FoxPro
Previous
Reply
Map
View

Click here to load this message in the networking platform