Results 1 to 3 of 3
  1. #1
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232

    Rounding up a time in a query

    Hi I use the following to calculate the time between a starting time and ending time. I would like it to round up to the next hour only.
    So if it would be 5.38 I would like it to round up to 6 hours.

    Time On Job: DateDiff("n",[arrived time],[completed time])\60 & "." & Format(DateDiff("n",[arrived time],[completed Time]) Mod 60,"00")

    The above works to calculate just need it to round up to the next hour.

    Thank you Angie

  2. #2
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    DateDiff("h",[DateOne],[DateTwo]) should work.
    12/18/2016 7:45:00 AM > 12/18/2016 11:00:00 AM is 4 even though it is 3 hours and 15 minutes.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    Thanks everyone it works great.

    Angie

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

Similar Threads

  1. Query to stop rounding off currency
    By Ruegen in forum Queries
    Replies: 4
    Last Post: 07-24-2013, 09:49 AM
  2. Rounding a number in a query
    By libraccess in forum Queries
    Replies: 3
    Last Post: 08-25-2012, 09:13 AM
  3. percent query rounding less than .5 up
    By jtmo3 in forum Queries
    Replies: 3
    Last Post: 05-04-2012, 02:52 PM
  4. Rounding Time
    By nknigi in forum Access
    Replies: 2
    Last Post: 01-09-2012, 11:10 AM
  5. Rounding the Average in a Query
    By jakelufkin in forum Access
    Replies: 3
    Last Post: 06-19-2009, 08:31 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