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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, Thanks for looking at my que 1

Status
Not open for further replies.

bustersports

Programmer
Sep 25, 2002
92
US
Hi,

Thanks for looking at my question.

I am importing a spreadsheet into my database that is all text. The import is checked for accuracy and field requirements (not every instance requires the same fields being completed). Part of the check is to verify the total dollar amount is correct in that all 12 possible fields for dollar values equal the total billed amount. The problem is when the spreadsheet is imported, dollar values changed to a number field (I have tried single, long, and double) format with currency (tried without as well), decimal places = 2, the totals are not matching after the field type is changed. Even when they are do total correctly when still in a text format. Below is an example of what is happening.

Original Spreadsheet
Item Amount1 Amount2 Amount3 Total Billed
a 1113.74 6815.89 7929.63 (note that it is common to not have a value in each Amount field)

After import
Item Amount1 Amount2 Amount3 Total Billed
a 1113.73999023438 6815.89013671875 7929.6298828125

What I need to have is nothing past 2 decimal places and the total should match up, in other words it should be exact as the import.

When errors are detected the processing stops and the user is notified to reject the file. Obviously, this is creating a problem by rejecting them when they are correct.

After the error checks are done on each field, the file is exported back into a text file. This is working fine.
Not sure what is causing this problem. Any ideas?

Thanks
 
Did you try a Money field type ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks very much. I changed it to a Data Type of currency and it worked. Looked at this just too long for such an obvious solution. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top