Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Odd SELECT result
Message
From
27/09/2002 12:07:53
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00705231
Message ID:
00705292
Views:
9
>Thanks everyone for the work arounds. Making the 2 strings the same length gives the correct results I'm just not convinced why the original doesn't work, the help implies that it should!
>
>"" = "ab"   gives no match
>
>Compare an empty string to something give no match!

Caroline,

I bet your set ANSI is Off. Ie '' = '' (memo blank, compared to left(te,0), is equal)

OFF

Specifies that the shorter string not be padded with blanks. The two strings are compared character for character until the end of the shorter string is reached. Consider this comparison:

'Tommy' = 'Tom'

The result is true (.T.) when SET ANSI is off because the comparison stops after 'Tom'.

String Order In SQL commands, the left-to-right order of the two strings in a comparison is irrelevant — switching a string from one side of the = or == operator to the other doesn't affect the result of the comparison.


set ANSI on and redo the select
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform