>>>I am creating a file name and then trying to create that file with data from a single record in a table a table - what am I doing wrong?
>>>
>>>SELECT collections
>>>
>>>refa="c:\driver\"+ALLTRIM(str(collections.refno))+ALLTRIM(collections.driver)+".csv"
>>>
>>>Copy To refa DELIMITED WITH "" WITH CHARACTER "|";
>>> FIELDS acclient,acad1,acad2,acad3,acad4,accontact,actel,coldate,readyat,closedat,notes,commodity,pieces,weight,globcutoff
>>
>>And what goes wrong? Btw, instead of ALLTRIM(str()), you can simply use Transform().
>>
>>Update: Try
Copy To (refa) DELIMITED WITH "" WITH CHARACTER "|".....>
>Thanks - have solved it - there was a space in the driver field which was causing a problem
>
>But thanks as always
Fine. I hope you also added the () around refa, or your file will always be called refa.txt.