Results 1 to 3 of 3
  1. #1
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Currency stored no of dec places (Access 2003 SP2)

    Having imported a currency field from SQL Server into an Access table i find that the number of decimal places is 4.

    I have another table populated by Access into a currency field and i find that the number of decimal places there is 2.

    When i try to query the 2 and compare them, they are not equal, eg $3,163.63 is not equal to $3,163.6299, if you look at the amount in table view it shows as $3,163.63 but when you place the cursor in the field it shows as $3,163.6299.

    Is there a way to compare them?

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

    Re: Currency stored no of dec places (Access 2003 SP2)

    The Currency data type stores numbers with a precision of 4 decimal places. If you have values such as 3263.6299, those values are probably the result of calculations that introduced small rounding errors.
    If you want to compare values with a precision of 2 decimal places, use calculated expressions in your query of the form Round([FieldName],2). This will remove the rounding errors.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Currency stored no of dec places (Access 2003 SP2)

    Thank you Hans, i thought i would have to do that or something similar, but it took quite a while to figure it out.
    When i was looking at 2 separate columns when both numbers were the same i was confused, when i finally put the cursor in each field and found that problem it was a relief of sorts.

    I live and learn, thanks again Hans.

Posting Permissions

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