Results 1 to 10 of 10
  1. #1
    Dano60 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2015
    Posts
    32

    Too many decimal

    Hi,

    I did an append query that make a division on a number in the table and overthought the decimal is set to 2 in the changing field, the equation return more decimal than 2.

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Set the number of decimals when you display the field to the users, never on tables. Leave the number of decimals on the table as Auto, when you need to display the field use the Format function.

  3. #3
    Dano60 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2015
    Posts
    32
    Hi,

    Very new to this Access thing.

    Can you please elaborate!!!!!

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    if you store data in a Currency field, it will only allow 4 decimals. (you can turn off the $ sign)

  5. #5
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Keep the properties of each field in table design sacrosanct, no formatting or lookups or anything that is added to plain data. Then whenever you want to display it use the format command, either in a query, form or report.

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You can use the Round() function around your calculation to limit the result to 2 digits.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Dano60 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2015
    Posts
    32
    Quote Originally Posted by pbaldy View Post
    You can use the Round() function around your calculation to limit the result to 2 digits.
    In that formula where would the round function go?

    IIF([Reliure_grosseur]=8;[quantiteSpirale]*((35*0.000957)/25);Switch([Reliure_grosseur]=10;[quantiteSpirale]*((35*0.001381)/25);[Reliure_grosseur]=11;[quantiteSpirale]*((35*0.00156)/25);[Reliure_grosseur]=12;[quantiteSpirale]*((35*0.00162)/25);[Reliure_grosseur]=14;[quantiteSpirale]*((35*0.001757)/25);[Reliure_grosseur]=17;[quantiteSpirale]*((35*0.002004)/25)))

  8. #8
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Ugg, I don't care for that hard-coded logic, but the function goes around each calculation, like:

    Round([quantiteSpirale]*((35*0.000957)/25), 2)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Dano60 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2015
    Posts
    32
    Thank you very much worked perfectly!!!!!

  10. #10
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Converting decimal value to hh:mm:ss
    By dezenzerrick in forum Access
    Replies: 1
    Last Post: 02-26-2016, 09:54 AM
  2. Convert decimal comma to decimal point
    By Hans Karlsson in forum Programming
    Replies: 3
    Last Post: 06-30-2014, 01:56 PM
  3. Decimal Places
    By momodoujimnjie in forum Access
    Replies: 1
    Last Post: 01-09-2013, 04:49 AM
  4. Need Currency or Decimal Help!
    By Jaricketts in forum Access
    Replies: 2
    Last Post: 08-19-2010, 09:39 PM
  5. Converting HH:MM to decimal
    By katrinanyc926 in forum Queries
    Replies: 5
    Last Post: 08-13-2010, 02:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums