Results 1 to 4 of 4
  1. #1
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839

    Round to next Even number

    I am trying to round up to the next even whole number.

    I can use Round(Myfield,Decimalposition) or (-Int(-Myfield)to get to the next whole number

    Examples TTL:
    33.33333
    13.88889
    16.66667
    6.944444
    55.55556

    FinalTTL: Round(TTL,0) or FinalTTL: -Int(-TTL) and they giveyou:
    33


    14
    17
    7
    56

    What I am wanting to do:

    If FinalTTL is an Odd number, add 1 to make it even.

    Final result:
    34
    14
    18
    8
    56
    Last edited by Thompyt; 11-22-2019 at 01:29 PM. Reason: formatting

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Try this:
    -Int(-([MyField]/2))*2
    where "MyField" is the name of your numeric field

  3. #3
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Thanks JoeM. I figured it might have something to do with /* but not sure how.

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You are welcome!

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

Similar Threads

  1. Replies: 3
    Last Post: 03-07-2019, 11:53 AM
  2. Round Function
    By gcgoode in forum Access
    Replies: 2
    Last Post: 08-07-2015, 11:08 AM
  3. Always Round Up (Never Down)
    By Derrick T. Davidson in forum Queries
    Replies: 3
    Last Post: 07-23-2013, 10:08 PM
  4. round up
    By Rhubie in forum Access
    Replies: 1
    Last Post: 08-29-2012, 05:14 PM
  5. Number Filed in Form auto round
    By blueraincoat in forum Forms
    Replies: 9
    Last Post: 04-11-2011, 06:18 AM

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