Exporting From Access

G

Guest

I have imported data in to an access database, and formatted the fields to
add leading zeros to a column which works fine, the zeros appear in the
table. I now need to export that data in a csv format, but the zeros do not
appear when I do the export. I have tried running a query and exporting that,
but have the same problem. How do I export to include the format that I set
on Import.

Thanks

Neil Hunt
 
D

Douglas J. Steele

If you're talking a numeric field, the zeroes aren't really there in Access:
formatting a field does not change the underlying value, and 001 is the same
as 01 is the same as 1 when you're talking numbers.

Use the Format function in your query (as opposed to setting the Format
property of the field):

SELECT Format(Field1, "00000"), Format(Field2, "0000"), ... FROM MyTable
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top