Agnes,
What's wrong with
padr(nvl(field, ''), 11)
>Yes.
>But there are still some apps with VFP 7.0 out here. I guess I will switch to BINTOC instead.
>
>Agnes
>
>>As you found out, it's better to use CAST() function in a query. It was created specifically for compatibility with SQL Server.
>>
>>>I run into this problem in a SELECT with an inner join.
>>>
>>>And, yes PADR(.NULL.,11) returns '.NULL. '
>>>
>>>But the SQL will set it to c(1). Other trimmings of PADR like PADR(...,...',_') will fail to. The browse will look like it holds eleven chars (SPACE in any way), DISPLAY STRU returns c(1)
>>>
Gregory