Results 1 to 2 of 2
  1. #1
    hellojosie is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    16

    VBA DateDiff in hours and miutes

    Hi,



    New to access and vba.

    I would like to calculate the difference in time and return the value to a field in hours and minutes. I have been on this for hours.

    At the moment I'm back to the basics.

    I have

    [TimesheetTotal] = DateDiff("n", [TimesheetStartTime],[TimesheetFinishTime])

    So this shows the time in minutes. But I really want to show the time in hours and minuets.

    Thank you in advance for any help

  2. #2
    hellojosie is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    16
    oooh and if I could do this over a 24 hour clock that would be super!

    I just got it to return hour and minutes using this formula:

    [TimesheetTotal] = DateDiff("n", [TimesheetStartTime], [TimesheetFinishTime]) \ 60 & "." & Format(DateDiff("n", [TimesheetStartTime], [TimesheetFinishTime]) Mod 60, "00")

    I would really love to be able to calulate this even if it goes into the next 24 hour period.

    Thanks for any help!!!

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

Similar Threads

  1. Can hours be sum?
    By newtoAccess in forum Queries
    Replies: 9
    Last Post: 10-10-2011, 11:01 PM
  2. Hours and OT Hours
    By Ruthers456 in forum Forms
    Replies: 2
    Last Post: 06-27-2011, 10:09 AM
  3. DateDiff
    By ROB in forum Access
    Replies: 2
    Last Post: 10-30-2010, 03:58 AM
  4. How to use DateDiff?
    By teirrah1995 in forum Queries
    Replies: 10
    Last Post: 10-19-2010, 12:07 PM
  5. hours + condition
    By Miriam in forum Queries
    Replies: 0
    Last Post: 08-09-2009, 06:46 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