[AccessD] Rounding Error - A2K

Heenan, Lambert Lambert.Heenan at chartisinsurance.com
Fri Dec 11 14:00:32 CST 2009


It's all there in the help file...

==============================================
/ Operator
      

Used to divide two numbers and return a floating-point result.

Syntax

result = number1/number2

The / operator syntax has these parts:

Part Description 
result Required; any numeric variable. 
number1 Required; any numeric expression. 
number2 Required; any numeric expression. 



Remarks

The data type of result is usually a Double or a Double variant. The following are exceptions to this rule:

If 
Both expressions are Byte, Integer, or Single expressions, Then result is  a Single unless it overflows its legal range; in which case, an error occurs. 
Both expressions are Byte, Integer, or Single variants, Then result is a Single variant unless it overflows its legal range; in which case, result is a Variant containing a Double. 
Division involves a Decimal and any other data type, Then result is a Decimal data type. 


One or both expressions are Null expressions, Then result is result is Null. Any expression that is Empty is treated as 0.
==============================================
Especially where M$ is concerned, it's not what you *think* would make sense, it's what they say is implemented that counts. :-)

Lambert
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Reuben Cummings
Sent: Friday, December 11, 2009 1:57 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Rounding Error - A2K

I need the result to be currency so everything is working perfectly.
I guess it just befuddles me that you could take a currency and if you divide it by 100 it would change back to double.  In my mind, it simply leaves it as currency and you lose two decimals.

Reuben Cummings
GFC, LLC
812.523.1017




More information about the AccessD mailing list