# Thread: Date diff hours and minutes (2003)

1. ## Date diff hours and minutes (2003)

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

2. ## 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. ## Re: Date diff hours and minutes (2003)

What does Mod 60 mean?

4. ## 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. ## 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
•