Normally, you would compute elapsed minutes for an interval as:
( Time2 - Time1 ) / 60
If you want a value of 0 when time2 = 0, use this expression:
If ( Balloon_time = 0 ; 0 ;
(Balloon_time - Doortime ) / 60
Thanks so much for helping. I think I'm still missing something. I've tried multiple permutations on your equation above and at best all I seem to be able to get is a boolean response with a 0 when time 2 (balloon_time) = 0 and a 1 when it doesn't.
Currently I have the calculation written as:
(Balloon_time - Door_time) / 60
If (Balloon_time = 0; 0;
(balloon_time - Door_time) / 60)
but this just makes all my calculations a "1". Rearranging the order or trying multiple If clauses such as:
If (Balloon_time ≠ 0; (Balloon_time - Door_time) / 60)
If (Balloon_time = 0; 0; (Balloon_time - Door_time) / 60)
also seems to set up a boolean expression rather than a 0 when time 2 is 0 and a calculated interval when time 2 is not 0 (which is what I'm after).
Any other thoughts?
thanks for the help.
Both Balloon_time and Door_Time should be fields of type time or both should be of type timestamp. You should use timestamp if there is any chance that midnight will fall inside the interval between these two times as subtracting timestamp values will still evaluate correctly where time fields will not.
Here's a demo file you can look at: http://www.4shared.com/file/YVcHlbNn/TimeIntervalMinutes.html