Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Posts
    79

    Unanswered: Totals off by .01

    I have a amount paid field defined as currency with auto decimals. On a form, I have a field that totals the amount paid field. Occassionally, the total field is off by .01. Any ideas>

  2. #2
    Join Date
    Mar 2006
    Posts
    33
    Provided Answers: 1
    how do you total it?
    Are you using the Sum function on the form footer?
    what data type is the amount fd?
    could you make the amount fd into a currency fd too...
    Abhi
    A2K3 WinXP Prof SelfLearner

  3. #3
    Join Date
    Mar 2004
    Posts
    79
    Yes, I am just us using sum function in the total field and that field is defined as currency also.

  4. #4
    Join Date
    Mar 2006
    Posts
    33
    Provided Answers: 1
    Can you change the fd types to the "long" and set the decimal place manually to four

    Later after the sum has been calculated in the form footer you can use the two decimals only
    Abhi
    A2K3 WinXP Prof SelfLearner

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Adding currencies

    I had a similiar problem with currency fields. You may want to format the currency value to 2 decimals before you save it and also force a format to 2 decimals when summing it as I believe currency fields will go to 3 decimal places when summing them.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    the currency datatype is a scaled "double-long-integer" (8 Byte) with 4 (scaled) places after the decimal.

    add, multiply, whatever ...it is all to 4 places after the decimal.

    you error is most likely coming from an earlier operation where you have used a non-currency non-integer non-long in a calculation to produce your currency data.

    find that error location. round at that location to reduce your calculated currency figure to two non-zero decimals NNNNNNNNN.NN00

    izy

    LATER forgot to mention: division, even by int/lng/curr can cause non-zero 3rd 4th decimal values
    Last edited by izyrider; 04-03-06 at 13:19.
    currently using SS 2008R2

  7. #7
    Join Date
    Mar 2004
    Posts
    79
    Thank you.

Posting Permissions

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