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

Export table to text file problem

Status
Not open for further replies.

JonathanTompkins

Technical User
Apr 30, 2002
2
GB
Hi,

I'm trying to export data in a table to a fixed width text file. I'm using an import / export specification in which I can get almost everything right except 2 things, right justifying numbers (found an answer in another thread) and the number of decimal places. In the table they are formatted as 5 or 3 dec places but in the text file they always come out as 2 dec places. I'm beginning to think it can't be done this way and that I need to learn about schema.ini files or learn some visual basic. Is this the case?

Jonathan
 
Actually, if you change the from exporting a table to exporting the contents of a query that runs off of the table, you can solve your problem.

Using the Format() function, you can convert the number data type to a string which will cause it act differently in the export.

Use this example or look Format() or Format$() up in help:
Code:
=Format([MyField],"###0.00000")
The above version of the function will always result in five decimal places. If you decide to use the example, be sure to change the name of MyField to your field name. God Bless,
Mike

Yes, I believe in Jesus. ;-)
"Neither is there salvation in any other: for there is none other name under heaven given among men, whereby we must be saved." (Acts 4:12, KJV)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top