When I use Format it turns my numbers into text (ie.puts quotes around them) when I export to csv.
Main Topics
Browse All TopicsHi, I have a select query in MS Access 2007 that I am exporting to a .CSV file. I am using the export wizard to do this. This .csv file will be imported to our Accounting system so it requires specific formatting on the number fields. If there is no value for some of the fields the value must default to ".000". I can get the query to show "0.000" for the field but when I export it the value comes out as "0.00". Does anyone know how I can accomplish the export csv file to show ".000"?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
imstac73,
OK, last shot at doing this without code: go into the query desginer, and in the number format for that column,
use 0.000;-0.000;.000
Then see if the query export stays faithful to that format.
If not, then the only thing I can think of is to use code to write out to a file row by row. Not hard to do, but tedious :)
Regards,
Patrick
imstac73 said:
>>How do I write out the file row by row?
I can do it for you, or another Expert can if s/he gets to it before I do. I just need you to post a few rows
worth of what the output should look like, what the data types are, and any special rules like the number
formatting, whether text qualifiers are needed, etc.
Business Accounts
Answer for Membership
by: matthewspatrickPosted on 2009-06-01 at 17:16:54ID: 24523032
Hello imstac73,
Try using Format:
SELECT Amount, Format(Amount, "0.000;-0.000;.000") AS FormattedAmount
FROM SomeTable
Regards,
Patrick