create cursor x1 ( tWhen t, iCount i ) insert into x1 values ( {^2004-12-30 12:36:55}, 0 ) insert into x1 values ( {^2004-12-30 12:57:24}, 45 ) insert into x1 values ( {^2004-12-30 15:43:08}, 389 ) insert into x1 values ( {^2004-12-30 19:35:06}, 871 ) insert into x1 values ( {^2004-12-30 20:00:00}, 872 ) insert into x1 values ( {^2004-12-30 23:26:00}, 1339 ) insert into x1 values ( {^2004-12-31 03:19:59}, 1836 ) create cursor production ( iElapsedTime i, iIntervalCount i, iSecondsPerPiece i ) select x1 go top ltLastTime = x1.tWhen liLastCount = x1.iCount skip scan rest ltElapsedTime = x1.tWhen - ltLastTime liElapsedCount = x1.iCount - liLastCount insert into production values ( ltElapsedTime, liElapsedCount, ltElapsedTime / liElapsedCount ) ltLastTime = x1.tWhen liLastCount = x1.iCount endscanYou can then scan through the production table looking for rows where iSecondsPerPiece exceeds some acceptable average value and flag these the "breaks" you want.