Exporting to DBF with 5 decimal places

Lobster1071

Registered User.
Local time
Today, 17:53
Joined
May 18, 2008
Messages
23
This seems like a simple problem which should have a simple solution, but I cannot find the answer with the little bit of poking around I've done.

I simply would like to take a fields with a number format (Single, Fixed, 2 decimal places) and export it to a DBF file.

However, when they are exported to a DBF format (DBase IV), they format themselves as a numeric value with 5 decimal places.

For example, an Amount field will have the values in Access:
0.32
0.65
1.06

When I open the exported DBF file in FoxPro, the values are:
0.32000
0.64999
1.06000

I am currently getting around this by using an append query to send the data to another table which has the amount field as a Text format, then exporting that table. I use a "format" command like cAmount: Format(CStr([Amount]),"Standard") to get it into a text format.

This at least puts the data into the 2 decimal format that I need, even though it is a character string, but it's better than nothing.

I found this http://support.microsoft.com/kb/891775 but would like to know if anyone has found a better solution.

Anyone know of a way to export numeric data with only 2 decimals directly into a DBF format?
 
Simple Software Solutions

I am assuming that the amount is the result of a calculation performed by Access. Even though you have set the property to 2 dec places it still retains the nth result. What you could try, and this is only a suggestion, it use the Round(Amount,2) instead for Format. Also is the field in dBase set correctly?

CodeMaster::cool:
 

Users who are viewing this thread

Back
Top Bottom