local sCollate sCollate = set('Collate') set Collate to 'Machine' select * ; from Table ; into Cursor CursorTable ; where ( SomeCondition ) ; order by SomeOrder select *, ; recno() as r1 ; from CursorTable ; into Cursor x1 select x1 index on bintoc(r1+1) tag r1 select *, ; recno() as r2 ; from CursorTable ; into Cursor x2 select x2 index on bintoc(r2) tag r2 select x2.*, ; x2.DateTimeField - x1.DateTimeField as SecondTaken ; from x1, x2 ; where ( bintoc(r2) == bintoc(r1+1) ) ; and ( (x2.DateTimeField - x1.DateTimeField) > n ) set Collate to (sCollate)