>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