A lot of zeros

  • Thread starter Thread starter Yves
  • Start date Start date
Y

Yves

Hi,

I have a simple query that calculates on one column, (number minus it's
integer multiplied by 60)

plon_min:
((Abs([Drillhole_SURVEY]![DIP])-Int(Abs([Drillhole_SURVEY]![DIP]))))*60

The problem, is sometime I get results like 12.0000000000002

When it calculates a value of -48.2

-40.7 gives : 42.0000000000002

if I have -51.4 I get simply 24....

And I have no other "hidden" digits in the column, I exported the file to
ASCII, DBF and excel, and -48.2 exports as -48.2, even in a VBA program, I
checked it's value and it is -48.2.

Anyone have a clue on what causes this.

I some time get this when simply substracting one column from the other.
 
Anyone have a clue on what causes this.

Access (like all computer programs) stores decimal numbers in
"Floating Point" format - an internal data storage consisting of a
binary fraction and an exponent. As such, some numbers cannot be
represented exactly (just as the fraction 1/7 cannot be represented as
a decimal, the fraction 1/10 is an infinite repeating fraction in
binary).

I'd suggest either using a Currency datatype (a huge scaled integer
with exactly four decimal places and no roundoff error) or using the
Round() function to round your expression.
 
That's fine, but this behavior only append to me within Access... Excel
don't behave like this, Nor does VBA and Foxpro...
 
Hi,

You didn't mention what data type you use for the column, if you use
Floating-Point Numbers, you may want to take a look at the article:

ACC2000: Rounding Errors When You Use Floating-Point Numbers
http://support.microsoft.com/default.aspx?scid=210423

Please feel free to reply to the threads if you have any questions or
concerns.


Sincerely,

Alick Ye, MCSD
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


--------------------
| From: "Yves" <[email protected]>
| Newsgroups: microsoft.public.access.queries
| X-Tomcat-NG: microsoft.public.access.queries
|
| That's fine, but this behavior only append to me within Access... Excel
| don't behave like this, Nor does VBA and Foxpro...
|
|
|
| "John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> a écrit dans le message
| de news: (e-mail address removed)...
| >
| > >Anyone have a clue on what causes this.
| >
| > Access (like all computer programs) stores decimal numbers in
| > "Floating Point" format - an internal data storage consisting of a
| > binary fraction and an exponent. As such, some numbers cannot be
| > represented exactly (just as the fraction 1/7 cannot be represented as
| > a decimal, the fraction 1/10 is an infinite repeating fraction in
| > binary).
| >
| > I'd suggest either using a Currency datatype (a huge scaled integer
| > with exactly four decimal places and no roundoff error) or using the
| > Round() function to round your expression.
| >
| > John W. Vinson[MVP]
| > Come for live chats every Tuesday and Thursday
| > http://go.compuserve.com/msdevapps?loc=us&access=public
|
|
|
 
The data type that causing me headache is Double, and it's the format Access
gives by default to the linked database (dbf)

And in Dbase the field is defined as Decimal, 2.

Thanks.
 
Hi,

As John said you may try other data type, such as decimal. It seems the
Access query behaves different from others. This problem isn't specific to
the link table, even with local table, it happens the same way. Article
210423 explains a similar situation for using Floating-Point Numbers
(double is Floating-Point Number). You may want to submit a wish for this
behavior in Access query:

http://register.microsoft.com/mswish/suggestion.asp

Please feel free to reply to the threads if you have any concerns or
questions.


Sincerely,

Alick Ye, MCSD
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


--------------------
| From: "Yves" <[email protected]>
| Newsgroups: microsoft.public.access.queries
| X-Tomcat-NG: microsoft.public.access.queries
|
| The data type that causing me headache is Double, and it's the format
Access
| gives by default to the linked database (dbf)
|
| And in Dbase the field is defined as Decimal, 2.
|
| Thanks.
|
| "Alick [MSFT]" <[email protected]> a écrit dans le message de
| (e-mail address removed)...
| > Hi,
| >
| > You didn't mention what data type you use for the column, if you use
| > Floating-Point Numbers, you may want to take a look at the article:
| >
| > ACC2000: Rounding Errors When You Use Floating-Point Numbers
| > http://support.microsoft.com/default.aspx?scid=210423
| >
| > Please feel free to reply to the threads if you have any questions or
| > concerns.
| >
| >
| > Sincerely,
| >
| > Alick Ye, MCSD
| > Microsoft Online Partner Support
| >
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| >
| > --------------------
| > | From: "Yves" <[email protected]>
| > | Newsgroups: microsoft.public.access.queries
| > | X-Tomcat-NG: microsoft.public.access.queries
| > |
| > | That's fine, but this behavior only append to me within Access...
Excel
| > | don't behave like this, Nor does VBA and Foxpro...
| > |
| > |
| > |
| > | "John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> a écrit dans le
| message
| > | de news: (e-mail address removed)...
| > | >
| > | > >Anyone have a clue on what causes this.
| > | >
| > | > Access (like all computer programs) stores decimal numbers in
| > | > "Floating Point" format - an internal data storage consisting of a
| > | > binary fraction and an exponent. As such, some numbers cannot be
| > | > represented exactly (just as the fraction 1/7 cannot be represented
as
| > | > a decimal, the fraction 1/10 is an infinite repeating fraction in
| > | > binary).
| > | >
| > | > I'd suggest either using a Currency datatype (a huge scaled integer
| > | > with exactly four decimal places and no roundoff error) or using the
| > | > Round() function to round your expression.
| > | >
| > | > John W. Vinson[MVP]
| > | > Come for live chats every Tuesday and Thursday
| > | > http://go.compuserve.com/msdevapps?loc=us&access=public
| > |
| > |
| > |
| >
|
|
|
 
Back
Top