Results 1 to 5 of 5

Thread: Rounding Time

  1. #1
    Lounger
    Join Date
    Aug 2008
    Location
    Daytona Beach, Florida, USA
    Posts
    42
    Thanks
    3
    Thanked 0 Times in 0 Posts
    In a query I am using the following expression to calculate total number of hours worked, but have modified the database to use a check box to sign in and out which automatically inputs the current time.

    Qty: Round((IIf([Sign Out]<[Sign In],[Sign Out]+(1-[Sign In]),[Sign Out]-[Sign In]))*24,2)

    I need to have the total time rounded to the nearest 15 mins mark, such 8:13 to 8:15 or 2:02 to 2:00

    Can someone please help?

    Thank you and Happy Thanksgiving!


  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Brandy,

    See this poston the Mr. Excel site you should be able to adapt it once you know the trick.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    RetiredGeeks post certainly seems to point you in the right direction, but a further question.

    Do you want to round the times, then sum them? Or sum them as entered, and round the result? There could be quite a difference in the results.

    This article by Allen Browne adds some interesting extra info as well.
    Regards
    John



  4. #4
    Lounger
    Join Date
    Aug 2008
    Location
    Daytona Beach, Florida, USA
    Posts
    42
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Round the times, then sum them - I will check out the post on Mr. Excel

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    In that case it might be better to round each figure as it is entered (in future)
    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •