Response Times

REDaughdril

Registered User.
Local time
Today, 16:10
Joined
Jan 23, 2000
Messages
58
I have a set of times I need to calculate the laps time:
Notification Time
En Route Time
On Scene Time

I need to subtract En Route time from Notification Time and On Scene Time from Notification Time.

I also run into a problem when calls start at 23:15 and end in 00:15.

Can someone help me make a formula to get the hours, minutes and seconds for each.

Thanks
 
Assuming the times are stored in date/time fields (i.e. not text), try this:-

Format(IIf([En Route Time]>[Notification Time], DateAdd("d",1,[Notification Time])-[En Route Time], [Notification Time]-[En Route Time]),"hh:nn:ss")


What it does is that if En Route Time is larger than Notification Time, adds one day to Notification Time before subtracting En Route Time.

Hope it helps.
 
REDaughdril-

…Pat's and Jon's responses bring up a couple of questions:

(1) Are you even storing the date? Hopefully so although, from the example, that wasn't clear.

(2) Jon-what happens with your solution if the period spans more than two days (e.g., starts at 23:59 (11:59 PM) on the 23rd and ends at 00:01 (12:01 AM) on the 25th?) Understand that it's not likely, but still need to plan for the unexpected, or am I missing something?

Bob
 
Thanks Bob, you are absolutely right about the need of storing also the date if the times may span more than 24 hours.

As REDaughdril gave an example of starting at 23:15 and ending at 00:15, I guessed the time span was within hours, so I offered a simple arithmetic answer. I should have remarked that my answer is good only if the times do not span more than 24 hours.

Thanks again, Bob.
 

Users who are viewing this thread

Back
Top Bottom