Transfer Text with more than 2 decimals.

B

Bruce

Hi,

I am running the following function to export data to a terxt file. My data
is of type double where values contain 2 or 3 decimal places. When I run this
function all data is converted to 2 decimals.

Function Export_Last()
DoCmd.TransferText acExportDelim, "spec_Data", "q_Export_Last", destdir
& "LastUpdate.txt", False, ""
MsgBox ("Finished")
End Function

In the query 'q_Export_Last', viewing the results I can see data that is
either 2 or decimals.


The 'Spec Data' argument is a specification which I have defined the export
to fields also as double.

How can I export without changing the data. i.e. no round to 2 decimals?

Bruce
 
A

Alex Dybenko

Hi,
you can try to format your double field as:
format ([MyField],"0.000") in a query, to be sure that all decimals are
there
 
B

Bruce

Thanks Alex,

Made changes as suggested. When the query is run all values are formatted to
3 decimals, even if not necessary eg. 1.230 (where the last has no bearing).

When I export the data to txt it is still as 2 decimals. I am not sure why.

Any further ideas that I could try?

Alex Dybenko said:
Hi,
you can try to format your double field as:
format ([MyField],"0.000") in a query, to be sure that all decimals are
there

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Bruce said:
Hi,

I am running the following function to export data to a terxt file. My
data
is of type double where values contain 2 or 3 decimal places. When I run
this
function all data is converted to 2 decimals.

Function Export_Last()
DoCmd.TransferText acExportDelim, "spec_Data", "q_Export_Last", destdir
& "LastUpdate.txt", False, ""
MsgBox ("Finished")
End Function

In the query 'q_Export_Last', viewing the results I can see data that is
either 2 or decimals.


The 'Spec Data' argument is a specification which I have defined the
export
to fields also as double.

How can I export without changing the data. i.e. no round to 2 decimals?

Bruce
 
A

Alex Dybenko

perhaps excel shows only 2 decimals? try to change formating in excel

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Bruce said:
Thanks Alex,

Made changes as suggested. When the query is run all values are formatted
to
3 decimals, even if not necessary eg. 1.230 (where the last has no
bearing).

When I export the data to txt it is still as 2 decimals. I am not sure
why.

Any further ideas that I could try?

Alex Dybenko said:
Hi,
you can try to format your double field as:
format ([MyField],"0.000") in a query, to be sure that all decimals are
there

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Bruce said:
Hi,

I am running the following function to export data to a terxt file. My
data
is of type double where values contain 2 or 3 decimal places. When I
run
this
function all data is converted to 2 decimals.

Function Export_Last()
DoCmd.TransferText acExportDelim, "spec_Data", "q_Export_Last",
destdir
& "LastUpdate.txt", False, ""
MsgBox ("Finished")
End Function

In the query 'q_Export_Last', viewing the results I can see data that
is
either 2 or decimals.


The 'Spec Data' argument is a specification which I have defined the
export
to fields also as double.

How can I export without changing the data. i.e. no round to 2
decimals?

Bruce
 

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