Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting from Access causes 5 decimal places on integer types

Status
Not open for further replies.

ddelk

Programmer
May 28, 2003
47
US
When I export an Access table to dbase IV, all my integer (long integer too) values come out with 5 decimal places. I need to ensure that the structure does not change as my program requires integers not floats. Any suggestions?
 
When you export to dBase specify a fixed length format. If Access sends you extra data you can strip the data down by defining a dummy field in the dBase database which begins at the decimal point putting the decimal into a seperate field.
 
I assume you mean specify the fixed length in the table design? I did that, putting the number as long integer. I still get the trailing 0's. Is it possible to specify the format during the actual export?
 
ddelk
There are different formats which you can export to, one of them is fixed length text. You may have to limit each record to 255 characters but if you are having a problem with extra data you can strip this data as it will always appear in the same location in a fixed length text record. You can import only the integer portion of the data into the correct field and create a dummy field in which you import the decimal portion of the data. If you are concerned about having an extra field then delete the field and append the records to your database.
 
BillPSUs answers are not very helpful for me...

Have you, ddelk, or anybody else found a solution for this problem? I am facing the same problem and have no clue how to solve it - and cannot export to CSV or sth. else, or change the format of the dBase table since there is a 3rd party application which imports the dBase data and expects the exact format of the tables and fields...
 
I finally found it (with the help of someone else) that to get rid of the 5 decimal places you have to define your fields in the table to be exported as DECIMAL. Then you can define the number of digits and decimal places for each field and when exporting to dbase (5.0) the fields in the .dbf file are like expected. Took me a while, but better late than never...
 
Can you supply the code? I cannot find where I am able to define the export as decimal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top