That is correct. That is the problem I am asking for assistance with. I do not expect any single SELECT to do the work.
>>No I do not. Since I am interested in how to process this file in order, I am only concerned about its records.
>>
>>However, if a solution required that in order to work, I could certainly add the records (the file does not yet exist, but will shortly)
>>
>What do you have in ParentID field for parents (or do you plan to have).
>
>If parents have NULLs in the ParentID field, it's easy to separate parents from children. However, if you want to order your records in the order by generations (Grandparents - parents - children - grandchildren) then I don't think there is a way in VFP to do so in one select statement. You need recursive function here and create a new table with extra field showing the number in the generations chain.
Jim Nelson
Newbury Park, CA