Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Apr 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calculated Expression (Access 2000)

    In a simple query I am trying to calculate a difference. Diff: [Total] - [Amount1] - [Amount2]. All fields are defined Number, Double, Fixed and 2 decimals. In some instances the calculation works in others I get scientific notation as a result. Any ideas?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calculated Expression (Access 2000)

    This is probably just formatting. Access stores number in binary format with finite precision. Decimal numbers often cannot be expressed exactly in binary numbers with a finite number of digits. Therefore, calculations may yield small errors. E.g., if you type
    ? 0.3 - 0.2 - 0.1
    in the Immediate window, you will get something like
    -2.77555756156289E-17
    while the exact answer is 0.

    In your query, click somewhere in the calculated field and bring up the Properties window. You can enter a format you like in the Format property, for instance Fixed. The result of your calculation will be displayed in that format.

  3. #3
    New Lounger
    Join Date
    Apr 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calculated Expression (Access 2000)

    Thanks for the quick response. It worked.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •