Hi!
First of all, even if you have an index by TRCODE, this query will not be optimizable, becasue AllTrim() function.
In queries the best technique is using of "==" and no AllTrim():
SELECT * FROM TABLE WHERE TRCODE == "103 " && or TRCODE == padr("103",{length of TRCODE field})
Hope this helps.
>I am doing a select like this:
>
>SELECT * FROM TABLE WHERE ALLTRIM(TRCODE) = "103"
>
>and I get results that include empty TRCODE values (Character 6).
>If I check at the same time ?ALLTRIM(SPACE(6)) = "103" it returns .F. as I would expect.
>
>Why is the select picking up these records?
>
>following SET's are:
>SET EXACT ON
>SET ANSI OFF
>SET NEAR OFF
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.