Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Nov 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date diff hours and minutes (2003)

    Is there a way to do a date diff and the result be in hours and minutes?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date diff hours and minutes (2003)

    Unlike Excel, Acces does not have a format for cumulative time (allowing for hours over 24). You can do compute it in a query: calculate the total difference in minutes using

    D: DateDiff("n", [Time1], [Time2])

    The difference in hours is

    H: [D] 60

    and the remaining minutes

    M: [D] Mod 60

  3. #3
    New Lounger
    Join Date
    Nov 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date diff hours and minutes (2003)

    What does Mod 60 mean?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date diff hours and minutes (2003)

    The Mod operator returns the remainder of whole-number division. For example: 18 mod 7 = 4, for 7 goes 2 times into 18 with a remainder of 4 (18 = 2 x 7 + 4), and 18 mod 6 = 0 for 6 goes exactly 3 times into 18 with no remainder (18 = 3 x 6 + 0).

  5. #5
    New Lounger
    Join Date
    Nov 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date diff hours and minutes (2003)

    Thanks

Posting Permissions

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