>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 .
Yep - this has to do with the SET ANSI setting and SQL - I suggest that you read thesections in the on-line doc for details. The following is an excerpt from the SELECT-SQL topic:
When you use the = operator with strings, it acts differently depending on the setting of SET ANSI. When SET ANSI is set to OFF, Visual FoxPro treats string comparisons in a manner familiar to Xbase users. When SET ANSI is set to ON, Visual FoxPro follows ANSI standards for string comparisons. See SET ANSI and SET EXACT for additional information about how Visual FoxPro performs string comparisons
Try using SET ANSI ON before the query