Export to text contains scientific notation

G

Guest

I am exporting numeric (currency type) fields to a delimited text file, and
any amount greater than 999,999.99 gets converted to scientific notation.
The recipient of the file can't handle scientific notation, and in any case
some of the precision is lost. How can I export to a delimited text file
(via Access macro or DoCmd.TransferText method) without converting to
scientific notation?
 
K

Ken Snell [MVP]

Export a query that is based on that table (don't export the table
directly). In place of the field that is to have 2 decimal places, use a
calculated field that formats the number the way you wish:

MyNum: Format([FieldName], "0.00")
 
G

Guest

I had already determined that workaround. My apologies for not including
that fact in my original question. Is that the only option? Why would it
not respect the precision of the underlying data type? Is the default
behavior (scientific notation) from Access, or the underlying ADO / DAO
functionality? The workaround does indeed work, but seems "kludgy" to me.
 
K

Ken Snell [MVP]

Not sure that it's a workaround, but it's the way that programmers do what
you want to do.

Can't speak to why it works that way, other than... that's the way it works.
<g>

--

Ken Snell
<MS ACCESS MVP>


FriendOfBOB said:
I had already determined that workaround. My apologies for not including
that fact in my original question. Is that the only option? Why would it
not respect the precision of the underlying data type? Is the default
behavior (scientific notation) from Access, or the underlying ADO / DAO
functionality? The workaround does indeed work, but seems "kludgy" to me.

Ken Snell said:
Export a query that is based on that table (don't export the table
directly). In place of the field that is to have 2 decimal places, use a
calculated field that formats the number the way you wish:

MyNum: Format([FieldName], "0.00")
 
G

Guest

Not sure that it's a workaround, but it's the way that programmers do what
you want to do.

Can't speak to why it works that way, other than... that's the way it works.
<g>

Fair enough ... thanks for your help.
 

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