A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Strange values when summing in a query



 
 
Thread Tools Display Modes
  #1  
Old May 10th, 2008, 04:43 PM posted to microsoft.public.access.queries
Kjell Harnesk[_2_]
external usenet poster
 
Posts: 11
Default Strange values when summing in a query

Why is it that a query in Access resturns strange values when summing simple
figures.
Example: I have a number of records with a number field values like 8 7.5
6 8 12 9.3 and so on.
When I make a query that sums these fields the correct sum may be 269.3 but
in the query is says 263.30000000013
or something like that.

--
Kjell Harnesk, Sweden.

  #2  
Old May 10th, 2008, 06:20 PM posted to microsoft.public.access.queries
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Strange values when summing in a query

It's floating point round-off error.

Just as humans can't represent certain fractions exactly in base 10 (think,
for example, 1/3, which is 0.333333 repeating), so too computers can't
represent certains fractions exactly in base 16. There's an entire branch of
computer science call numerical methods (or numerical analysis) devoted to
the study of how to reduce round-off error.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Kjell Harnesk" wrote in message
...
Why is it that a query in Access resturns strange values when summing
simple figures.
Example: I have a number of records with a number field values like 8 7.5
6 8 12 9.3 and so on.
When I make a query that sums these fields the correct sum may be 269.3
but in the query is says 263.30000000013
or something like that.

--
Kjell Harnesk, Sweden.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.