Results 1 to 7 of 7
  1. #1
    newbie is offline Advanced Beginner
    Windows XP Access 97
    Join Date
    May 2009
    Posts
    34

    Question Round Up/Down 4 Decimals to 2


    I am working in MS Access 2003. I have imported tables that have 12 digit text fields that look like this 000000012572. I have created a new text box on my report that has a control source of =Val([fieldname]) and a format of #\.0000 so that 000000012500 now displays as 1.2572. This is great for most of my fields except one. I need one of my fields to round the decimal to 2 places so that 1.2572 would be displayed as 1.26. Does anyone have any suggestions on how to do this? THANKS!

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    can you use round(xxxx,2)?

  3. #3
    newbie is offline Advanced Beginner
    Windows XP Access 97
    Join Date
    May 2009
    Posts
    34
    No, I already tried that. I continue to receive 1.2572.

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    can you show me how did you get 1.2572 from 0000012572?

  5. #5
    newbie is offline Advanced Beginner
    Windows XP Access 97
    Join Date
    May 2009
    Posts
    34
    I created a text box and in the control source I used Val([Field Name]) and on the format of the text box I used #\.0000. The Value expression removed all my leading zero's. The #\.0000 formated it so that that a decimal point was placed 4 digits in and that if the first number after the decimal is a zero it will still show.

  6. #6
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    change the format to standard, and use =val[field]/10000 as control source

  7. #7
    newbie is offline Advanced Beginner
    Windows XP Access 97
    Join Date
    May 2009
    Posts
    34

    Talking

    Brilliant! Thank you.

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

Similar Threads

  1. Replies: 1
    Last Post: 02-04-2010, 11:17 AM
  2. Replies: 1
    Last Post: 06-09-2006, 05:44 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