>Rob,
>Thanks again for replying. As I promised I provided code to create test table and one of my working routines so far (in reply to myself). Honestly before I even didn't try 'count' but this time tested it too.
>FYI here are some test results (might not be exact but gives idea) - Athlon 650Mhz, 192 Mb:
>Routine provided : 26-27 secs
>With count implementation (also tried 'count while' instead of 'count for' ) :
>Didn't complete over half an hour and after shutting down via taskbar tested with 10 times smaller test table. Completed over 12 mins.
>
>Trying a few other routines that use array processing and FLL bit masking. They sound to be faster but no complete prototype for them yet.
>Still in need of streoids :)
How about doing a count first, i.e. group on all the existing fields and add count(*) as an extra field. Then select from this new table twice, only shifted by one, i.e. where recno("first")=recno("second")-1 and [other grouping criteria as the first time]. Thus you would have the record and the next record side by side; if the nStart of the second is less than the nEnd of the first, that's your new interval.
Mmmm.. a bit hard to put in words, but I hope you understood what I mean.
(if steroids fail, use asteroids... :)