Link to home
Start Free TrialLog in
Avatar of gtvingo14
gtvingo14Flag for Afghanistan

asked on

Why is Access not pulling the decimals in during import?

When we import a file into access, the decimals values are not pulled in by ACCESS. By example 125.50 would come out like 125.00. The field data type has been set to be a number (double, fixed, 2 decimal places). What else do we need to do so that the number can be pulled in with the decimals?
thanks
Avatar of xassets
xassets

Check the datatype on the actual import (step 2 or 3 I think in the import wizard)

Its probably defaulting to Long Integer for some reason.

Otherwise please post more details on the source file format and exactly how you're importing it.
Avatar of gtvingo14

ASKER

I am using this line in the VB program but the field where I am having the problem
is set to be a number (double, fixed, 2 decimal places).
.DoCmd.TransferText , , Dst_table, Form1.m_path & src_file, 0
I think you will need to develop an import specification, as follows:

Import the data once manually, and use the "Advanced..." button in the import wizard. This will allow you to change and save the import spec inside your database. Inside there you can change the types of each column as they are imported.

Then the second parameter of the transfertext command must be changed to the name of the spec you saved.

I would also recommend specifying acImportDelim on parameter 1, and explicitly specify the separator.
That sounds good. Thanks
how do I re-open or rename my spec?
Inside the Advanced... button, the dialog box has a save as... button

To edit the spec go back to the manual import, click Advanced again, and click the "Specs..." button. Then you can choose from a list of specs.

This is access 2000, maybe the buttons are slightly different in different versions.

Sounds good but it did not work. I am still getting those values with only zero on the
decimals. I did make sure that I have acImportDelim on parameter 1 and the name of my spec was correct.

.DoCmd.TransferText acImportDelim, lnlin, Dst_table, Form1.m_path & src_file, 0
OK I'll work on it now with a test case...
ASKER CERTIFIED SOLUTION
Avatar of xassets
xassets

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial