>I have the following test ,cant understand it... it must be a bug
>
>Select MYFILE (20 records on file)
>Replace All Myfield with Space(1)
>
>Select * from Myfile where Myfield <> 'ABC'
>.... returns 20 records
>
>Select * from Myfile where Alltrim(Myfield) <> 'ABC'
>.... returns zero records
>
>Can anybody explain this .
>
>Regards,
>
Gerard,
You are seeing how xBase compares strings as Ed has told you. The comparison is controlled by the shorter of the two strings. Your ALLTRIM() is giving a string of 0 length so there is no comparison being done and the 'ABC' is considered equal to the 0 length string.
You can use SET ANSI (for SQL) or SET EXACT (for xBase commands) or you can change your SELECT to say;
WHERE NOT Myfield == 'ABC'