Hi Kirk,
The problem is deeper than just ALLTRIM(). Before VFP can run a query it has to determine the size of all the fields in the result regardless if result is directed to a cursor, array or whatever is allowed. VFP uses one record from the table (usually it's the first physical record) to do that. In the case of ALLTRIM() the lenght of the result field is unpredectable and based solely on that record values. That's why it's better not use ALLTRIM() in such cases and use PADR() to guaranty the lenght of the charcter filed. Also applying any string function to a memo field converts it into the character data type field with max lenght of 254 charcters.
>Sergey
>
>Thanks for the help. the alltrim() seemed to be the problem.
>
>Kirk
--sb--