> I guess I didn't make it clear enough. That's what I am doing. The substitution of Transform()) is only for Alltrim(Str()). The Val() is there in both cases. I know Transform() returns what I want, but when it gets into the Field within the Select, it has become '1'. Likewise with my UDF. It has the correct string to RETURN, but when the Select gets it into the field, it has also beocme '1'.
>
Dave,
This is becasue the size of the field int eh cursor that SELECT creates it set by the first reord's value. IN your example it is being set to 1 char and so all records get at most 1 character of data. You need to use either PADR() to force the value to be as wide as the widest data value that the feild will get;
lcValue = PADR(TRANSFORM(VAL("0001972")),7)
JimB
www.JamesBooth.comMVP 1993-2003
Microsoft Certified Professional in VFP