Joined: 21 Aug 2017
Location: United States
Online Status: Offline
Posts: 39
Topic: Difficulty getting difference between two times Posted: 09 Oct 2017 at 6:17am
Hello everyone,
I'm having difficulty getting the difference between two time fields in Minutes. Both are strings {Arrival_time} and {Appointment_time}. They are both strings displaying time as 00:00 AM/PM. Also, {Arrival_time} is sometimes blank.
I used this formula to replace the "" as N/A:
if IsNull({appt_data.time_of_arrival}) then
"<null>"
else
if {appt_data.time_of_arrival} = "" then
"N/A"
else
CStr (Time({appt_data.time_of_arrival}), "h:mm:ss tt")
If I filter out the "N/A" and use the formula:
datediff("n",datetime({@Time arrival time}),datetime({appt_data.appointment_start_time}))
It works. If I bring back the "N/A" I get the "Bad Time Format String" message.
Joined: 21 Aug 2017
Location: United States
Online Status: Offline
Posts: 39
Posted: 11 Oct 2017 at 5:09am
I was able to figure it out so that it returns a zero but the problem is if I wanted to do an average then the 0 would skew the data. So maybe it needs to return a a "N/A"
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 11 Oct 2017 at 7:13am
that wont help your issue with the average.
use a running total as an average with a evaluate formula to exclude rows where IsNull({appt_data.time_of_arrival})
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum