Skip to main content

comparison between lines

Hi;
I've a database that I need to compare between the line 1 and the line 2 ...e, 
for example :  
In this case; i need to get the difference between the start call of line 2 with the end call of line 1  and 
 Thank you.

START CALL
DURATION
Duration_HOURS 
End_Call

17:26:18
139
00:02:19
17:28:37

17:28:50
60
00:01:00
17:29:50

17:29:52
45
00:00:45
17:30:37

Brian Element Sun, 10/22/2017 - 10:40

Hi Ahmed,

If I understand what you want you can do this by creating a vritual numeric field with this equation:

@if(@Recno() =1, 0, @Tton(START_CALL) - @Tton(@GetPreviousValue("END_CALL")))

So if it is the first record just put 0 into it.  It then takes the number of seconds from the START_CALL and subtracts the number of seconds the previous END_CALL.  The one problem will be when you switch days.  It also assumes the file is in order by START_CALL.

Brian

Ahmed Sun, 10/22/2017 - 11:10

Hi Brian,
yes, the problem will be when the date is different; but now what i'm doing is summurizing by date. 
for the rest, thank you very much for your help.