LillyC
asked on
How to show hours and minutes in a query in MS Access
I just can't get this right grrrrrrr, I'm trying to show the number of hours and minutes, I can get the hours and the minutes separately but want to show as hours/minutes, eg 100 hours = 1 hour 40 minutes
Lateness Total Hours: (DateDiff('n',[Time due in],[Time arrived])/60)
Lateness Total Minutes: (DateDiff('n',[Time due in],[Time arrived]))
Lateness Total Hours/Minutes: (DateDiff('n',[Time due in],[Time arrived]))-(DateDiff('n',[ Time due in],[Time arrived]))/60
Lateness Total Hours: (DateDiff('n',[Time due in],[Time arrived])/60)
Lateness Total Minutes: (DateDiff('n',[Time due in],[Time arrived]))
Lateness Total Hours/Minutes: (DateDiff('n',[Time due in],[Time arrived]))-(DateDiff('n',[
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The above works if you want separate hours and minutes, or you could parse Gustav's solution results.
ASKER
Superb - thank you both :)
You are welcome!
Hours = DateDiff("h",[Datetimein],
This should give you the leftover minutes after you subtract the full hours:
Minutes = DateDiff("n",[DatetimeIn],
Works for me....