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

Export Fixed Width File - align numeric fields 1

Status
Not open for further replies.

jog

Programmer
Sep 13, 2000
4
0
0
US
I've created an Access database and would like to export one of the tables to a fixed width text file. I have several numeric fields which I can not get to align correctly. I have tried defining the fields both as text and number(double), but when I export, I keep dropping the leading zeros which causes the balance of the fields to lose the alignment. Any suggestions?

Thanks
 
I have had to add dummy text fields to contain zeros and using them for the leading zeros. I then run a macro that runs a series of update queries to put the correct number of zeros into the column.

update to: 00000
criteria - between 10 and 99

update: 0000
criteria - between 100 and 999

etc.
 
If I understand everything correctly...can you create a query and use the following expression:

ExportField01: Format([lngNumberHere],"00000")

If the value of lngNumberHere is 25, then ExportField01 would have "00025" as a value.

Then export the query instead of the table...

I hope this helps.

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top