J
Jay
Hi All -
I'm using a VBA procedure to export data from an Access table to a CSV file.
The table has nine text fields and one single-precision, numeric field. The
single-precision field contains numbers that are displayed with a variety of
decimal places, for example 0, 0.1, 5, 7.215, etc.
The following VBA statements export the data properly to a CSV file with the
exception that the numeric field is truncated at 2 decimal places. For
example, the value 7.215 becomes 7.21 in the CSV output file.
outFName = "G:\Data\MyData.csv"
DoCmd.TransferText acExportDelim, , "tblMyData", outFName, True
Any ideas why this value is being truncated? I can't find any options for
setting decimal places for an export using the TransferText method.
Note that value zero (0) in a record shows up in the CSV field as 0.00, the
value 0.1 as 0.10, and the value 5 shows up as 5.00. Also, if I perform the
export manually in Access (File, Export... to run the 'Export Text Wizard'),
the same thing happens (shorter values are formatted to two decimal places
and longer values are truncated to two decimal places).
Thanks in advance,
Jay
I'm using a VBA procedure to export data from an Access table to a CSV file.
The table has nine text fields and one single-precision, numeric field. The
single-precision field contains numbers that are displayed with a variety of
decimal places, for example 0, 0.1, 5, 7.215, etc.
The following VBA statements export the data properly to a CSV file with the
exception that the numeric field is truncated at 2 decimal places. For
example, the value 7.215 becomes 7.21 in the CSV output file.
outFName = "G:\Data\MyData.csv"
DoCmd.TransferText acExportDelim, , "tblMyData", outFName, True
Any ideas why this value is being truncated? I can't find any options for
setting decimal places for an export using the TransferText method.
Note that value zero (0) in a record shows up in the CSV field as 0.00, the
value 0.1 as 0.10, and the value 5 shows up as 5.00. Also, if I perform the
export manually in Access (File, Export... to run the 'Export Text Wizard'),
the same thing happens (shorter values are formatted to two decimal places
and longer values are truncated to two decimal places).
Thanks in advance,
Jay