>>>I see - a bit tricky. I solved a similar problem with recursive cte (see
http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/cte-and-hierarchical-queries - though it doesn't work for best fitting).
>>>
>>>I think you may be better with dbase solution here rather than SQL.
>>
>>Argh. This is beyond my level - and I can't do it with VFP anyway. So we stuck to SCAN and LOCATE. (-.-)
>>
>>Agnes
>
>I'm just thinking it can be better solved with procedural code than with one or two select statements.
Think so. I have no idea how to formulate the sequence with sets.
Thank you
Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]