Tech Support Guy banner
Status
Not open for further replies.

Solved: Start Time End Time Difference in Microsoft Access 2000

9K views 7 replies 3 participants last post by  nesr 
#1 ·
Hi! I have put a "Total Time" field in a form to calculate the difference in minutes from the "Start Time" to the "End Time". I was worried about getting the incorrect time span when the time crossed over midnight. Well, I got that part right, but when I enter times in the same day (1:15pm-1:30pm) it gives me the time difference PLUS 1440 minutes. Please tell me what I need to do to fix this! Thank you!

Total Time:
=DateDiff("n",[Date]-IIf(1-[Start Time]>[End Time],0,1)+[Start Time],[Date]+IIf(1-[Start Time]>[End Time],1,0)+[End Time])
 
#2 ·
Assuming the dates are sequential, this would work for those over midnight items.
EXPR1: (IIf([End Time]<[Start Time],[End Time]-[Start Time]+24,[End Time]-[Start Time]))

You could also just add a previous date difference expression and use it in the formula in place of the simple "24" - if the difference in days was called [Days apart] then that value would be [Days apart]*24
 
Status
Not open for further replies.
You have insufficient privileges to reply here.
Top