Results 1 to 3 of 3
  1. #1
    JBM18 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    2

    Round up time half an hour

    All,

    I could use some help with a formula or vba.



    I am looking for something for Access that will work the same as Excel's forumla below:

    =TIME(HOUR(A1),CEILING(MINUTE(A1),30),0) --where time field is A1

    I want to round up times up half an hour (except the times right on :00 and :30). I do not want to round to the nearest half an hour.

    Example of what I am looking for:
    Time Formula Changes To
    12:10 12:30
    12:00 12:00
    12:22 12:30
    11:55 12:00


    Cheers,

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    newtime: (int(oldtime*48+0.999999999999) )/48

    half hour is 1/48 of one day.

  3. #3
    JBM18 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    2
    Perfect.

    I used that in combination with a format function to get:

    Format(((Int([order_time]*48+0.999999999999))/48),"h:nn AM/PM")

    Now my query is exactly what I need. Thank you for the help

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

Similar Threads

  1. Round Up/Down 4 Decimals to 2
    By newbie in forum Access
    Replies: 6
    Last Post: 10-18-2010, 02:58 PM
  2. Replies: 1
    Last Post: 02-04-2010, 11:17 AM
  3. run a half dozen reports from 1 click
    By techexpressinc in forum Reports
    Replies: 2
    Last Post: 12-17-2009, 11:20 AM
  4. [Access 2003] Displaying 24 Hour Time
    By Trainman in forum Access
    Replies: 4
    Last Post: 03-18-2009, 06:34 PM
  5. 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