Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting an Query to a csv file with fixed length field size.

Status
Not open for further replies.

grmman

MIS
Sep 9, 2003
81
US
I have to export this data from a query onto an csv file for a client.
The data in each feild has to be the exact length.
so for the first field:
id as to be 33.
in my table the feild length is only 10.
so when I created the export to csv comman del I cant get the feild to be 33.

I kn there is a simple answer but I cant get it.

Thanks
 
Move your data into another - staging - table where the length is 33. If necessary add a dummy row to the 'begining' of the query recordset (ie a record that sorts first) that has data of the required field lengths.

 
Or create a query dealing with the Format function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
If it's a one-off, why not use the Export wizard for csv? If you want to code it (either VBA or macro), use TransferText which can either work off a saved Export wizard specification or a schema.ini file.
Simon Rouse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top