How to export txt file without losing decimal place

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear Access guru,

I try to export query to txt file (in delimited format), however some
accuracy will be lost once i do that.
For example in Access query, the number is displaced as 0.12345. Once i
export into txt file, the same data is shown as 0.12. Only two decimal
places are recorded. Can someone please help me on this problem? I am using
Access 2002.

Thanks a million,
YP
 
In the query, use a calculated field in place of the original field that
needs to be exported with a specific number of decimal places (the default
in ACCESS is to export numbers with two decimal places). The following
example will export with five decimal places:

MyOutput: Format([MyField], "0.00000")
 
Ken,

I am having the same problem in Access 2003 and the format command does not
solve the problem. Values greater than 0.0100 will still truncate to 0.01
and values less than 0.01 show as scientific notation. You mention that the
"defaults" in Access is 2 decimal places. Can the default be changed? If
so, how?

Thanks

Tony

Ken Snell said:
In the query, use a calculated field in place of the original field that
needs to be exported with a specific number of decimal places (the default
in ACCESS is to export numbers with two decimal places). The following
example will export with five decimal places:

MyOutput: Format([MyField], "0.00000")
--

Ken Snell
<MS ACCESS MVP>

YPL said:
Dear Access guru,

I try to export query to txt file (in delimited format), however some
accuracy will be lost once i do that.
For example in Access query, the number is displaced as 0.12345. Once i
export into txt file, the same data is shown as 0.12. Only two decimal
places are recorded. Can someone please help me on this problem? I am
using
Access 2002.

Thanks a million,
YP
 
Post the SQL statement of the query that you're exporting.


--

Ken Snell
<MS ACCESS MVP>

asacco said:
Ken,

I am having the same problem in Access 2003 and the format command does
not
solve the problem. Values greater than 0.0100 will still truncate to 0.01
and values less than 0.01 show as scientific notation. You mention that
the
"defaults" in Access is 2 decimal places. Can the default be changed? If
so, how?

Thanks

Tony

Ken Snell said:
In the query, use a calculated field in place of the original field that
needs to be exported with a specific number of decimal places (the
default
in ACCESS is to export numbers with two decimal places). The following
example will export with five decimal places:

MyOutput: Format([MyField], "0.00000")
--

Ken Snell
<MS ACCESS MVP>

YPL said:
Dear Access guru,

I try to export query to txt file (in delimited format), however some
accuracy will be lost once i do that.
For example in Access query, the number is displaced as 0.12345. Once
i
export into txt file, the same data is shown as 0.12. Only two decimal
places are recorded. Can someone please help me on this problem? I am
using
Access 2002.

Thanks a million,
YP
 
Ken,
Here's the answer; I finally figured out what's happening:

my query groups and sums the data imported from 3 text files. when I
entered the "format" command into the query and choose "Sum" for this field,
Access changed the "Sum" to "Expression" and wrote the expression as
"Unts:Sum(Format([Units],"0.0000"). The "Sum" command was overriding the
"Format" command. By changing the expression to place the Sum inside the
Format, the data will export as text correctly: e.g.
Unts:Format(Sum([Units]),"0.0000").

Thanks for responding to my post.

Tony

asacco said:
Ken,

I am having the same problem in Access 2003 and the format command does not
solve the problem. Values greater than 0.0100 will still truncate to 0.01
and values less than 0.01 show as scientific notation. You mention that the
"defaults" in Access is 2 decimal places. Can the default be changed? If
so, how?

Thanks

Tony

Ken Snell said:
In the query, use a calculated field in place of the original field that
needs to be exported with a specific number of decimal places (the default
in ACCESS is to export numbers with two decimal places). The following
example will export with five decimal places:

MyOutput: Format([MyField], "0.00000")
--

Ken Snell
<MS ACCESS MVP>

YPL said:
Dear Access guru,

I try to export query to txt file (in delimited format), however some
accuracy will be lost once i do that.
For example in Access query, the number is displaced as 0.12345. Once i
export into txt file, the same data is shown as 0.12. Only two decimal
places are recorded. Can someone please help me on this problem? I am
using
Access 2002.

Thanks a million,
YP
 
Back
Top