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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export table - numeric fields with leading zero's

Status
Not open for further replies.

AT76

Technical User
Apr 14, 2005
460
US
Hi,

I'm exporting a table to a text file. I'm exporting it with fixed widths. Some of the fields are of type number. I need to add leading zeroes to these fields. Does anyone know how to do this?

Thank you in advance!
 
Export a query (playing with the Format function) instead of the table.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you PHV...

That worked... but now when I export the table to a TXT table it still removes the leading zeroes? I'm doing a fixed field length format. Any ideas?

Thank you!
 
I have tried
[tt]Format([intInteger],"000000")[/tt]
in a query and it seems to work as an export.
 
I used FORMAT([field name)], "00000") and it did work as far as placing the leading zeroes. But when I export it to a text file using a specified field length it removes the zeroes. Any thoughts?
 
This is not what I found. I chose export, txt, fixed width and found that I was loosing the numbers to the right. However, if I then chose Advanced and increased the size of the field, the numbers exported with the leading zeros. When another field followed the formatted field it was necessary to increase the start position by one. [ponder]
 
I guess another question to try and avoid this is can I export this table directly to the AS400?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top