query results

pl456

Registered User.
Local time
Today, 14:44
Joined
Jan 31, 2008
Messages
150
Why am I getting strange query results of -1.77635683940025E-15 when I subtract one field from another and they both hold the same figure.
So 8 minus 8?? I am expecting a zero.
 
Are the data types for these 2 fields set up the same?
 
I would say yes, they come from a linked table. I say they are the same because some results are fine and what I expect. It appears to happen when the figures are the same and the result should be zero.
 
still not sure why its doing it but I have changed the format for the field to fixed which gets the figures close to what I need.
 
I just tried this myself, with one field as an integer, and another as a long interger, in 2 separate tables. I put the value of 8 in each table, and then created a query that has the formulae "Expr1: [Table1].[a]-[Table2].", the result I got was '0' as expected. Have you tried this in a new database? Sorry can't think of anything else.
 
Open the table in datasheet view and click in the field that is giving strange results. If the value of 8 - which is displayed changes to something different then the figure of 8 indicates that this value is the result of a calulation or the value of an item imported into that field. Even though the value appears as being 8 any precision was inherited from the source.

Try this with both sides of the equasion. If I am wrong then as suggested try this with a new record wher you type in the number 8 manually.

CodeMaster::cool:
 
Computers work in binary. There are always errors in converting decimals and these tiny disrecpancies are the result. It's a good idea to use rounding to eliminate them.
 

Users who are viewing this thread

Back
Top Bottom