• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 225
  • Last Modified:

More decimal places then expected after Sum-function

Step1:
importing a txt-file in a MS-Access table.
content of txt-file looks like this:
--------------------------------
Workplace_ID Total_Amount(currency)
--------------------------------
aaa    23.23
bbb     2
ccc     123.7
aaa    45
bbb     4.6
aaa      0

etc.
--------------------------------
So, in the source txt-file not more than 2 decimal places.

Step2:
In a query I Group By Workplace_ID and Sum the Total_Amount collum.
The result looks like this:
--------------------------------
Workplace_ID   Total_amount
Group by        Sum
--------------------------------
aaa                68.23
bbb                6.6099999997
ccc                123.7000000001
--------------------------------

Here's my problem:
after Grouping by I get in the sum collum numbers with more than 2 (!) decimal places. In fact much more than 2, but not with all results! Where do they come from, because in the txt-file there are not more than 2?

0
Walter4
Asked:
Walter4
  • 2
1 Solution
 
mr_chinchin25Commented:
dunno if this will help, but try changing the format to fixed, and setting decimal places to 2.
0
 
LBooleanCommented:
when importing txt or csv files, make sure that your delimiter is not the same as your decimal indicator (. or ,) some strange results can happen if they are the same. You can check in the windows regional settings what your decimal indicator is.
0
 
Walter4Author Commented:
Dear mr. chinchin25,

I know how to solve the problem, but I was curious what the back ground was of these sum results.
I'll try LBoolean's comment in search of the rules behind this Access fact.

Thanx anyway!
0
 
Walter4Author Commented:
Dear LBoolean,
I'm importing with fixed spacings, so delimiters are no issue here, I think.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now