Results 1 to 3 of 3
  1. #1
    nknigi is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    1

    Rounding Time


    I have a report that uses the Format$ function. I'm trying to find out how many items are processed by the hour. When it breaks it down it is rounding up the time. 5:00 - 5:29 are showing under 5:00 but 5:30-5:59 are showing as 6:00. How can I get it to round down so 5:00-5:50 reports as 5:00. I'm using =Format$([entryTime], "h ampm",0,0) I can't find much help for the Format$ function.

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    What is the datatype of the entryTime field?

  3. #3
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I'll assume that your entrytime field is a date/time datatype, please correct me if I am wrong.

    In Access dates and times are not stored as you typically see them. They are stored as a number with the portion of the number to the left of the decimal point as the number of days since 12/31/1899. The portion of the number to the right of the decimal point holds the time as a fraction of a day. So 1/9/2011 12:00:00 PM is stored as 40917.5 (my date is mm/dd/yyyy).

    In terms of your report issue, you will have to convert the fraction of a day into something you can group by. The following expression should return the integer hour portion of the time. I used the timevalue() function to strip off the date portion assuming that your field had both date and time.

    INT(timevalue(EntryTime)*24)

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

Similar Threads

  1. rounding down
    By markcranmer in forum Queries
    Replies: 1
    Last Post: 10-11-2011, 09:43 AM
  2. Rounding
    By BLD21 in forum Reports
    Replies: 5
    Last Post: 06-20-2011, 01:06 PM
  3. Expression Rounding
    By Scorpio11 in forum Queries
    Replies: 6
    Last Post: 03-17-2011, 04:25 PM
  4. Rounding problem
    By chavez_sea in forum Access
    Replies: 6
    Last Post: 03-09-2011, 09:01 PM
  5. Rounding off
    By Alex Motilal in forum Access
    Replies: 4
    Last Post: 12-20-2009, 12:47 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