recursive problem

1. Junior Member
Join Date
Dec 1969
Posts
17

## recursive problem

Can anyone help with this problem. I want to get a list of all females in a particular family line. The fields i have are<BR><BR>earid = individual id<BR>damid = mothers individual id<BR>sex = male/female<BR>DOB = date of birth<BR>id = autonumber<BR><BR>The problem I am having that i can only retreive one generation. earid can graduate to damid should the have female daughters. is it possible to put in the earid and the results be a list of both the up and the down generations.<BR><BR>The topic is cows should anyone be wandering<BR><BR><BR>

2. Senior Member
Join Date
Dec 1969
Posts
3,921

## Huh?

3. Junior Member
Join Date
Dec 1969
Posts
17

## recursive problem better explained

sorry.<BR><BR>as before table has:<BR><BR>id, auto number<BR>earid<BR>damid<BR>sireid<BR><BR>I did not explain it very well. The asp takes a variable such as an earid. The sql then needs to find its damid(mother) and(father) sireid.(not a problem, easy in fact). I then need to find the dams and the sires parents.<BR><BR>In laymans terms you need to find the parents and grand parents in the table, and return in one query.<BR><BR>i.e.<BR>select earid, damid, sireid<BR>from livestock<BR>where earid = "variable";<BR><BR>this gets the mother and father i then need to get the parents parents.<BR><BR>thx in advance<BR><BR>

4. Senior Member
Join Date
Dec 1969
Posts
3,921

## Much better off...

...storing the original thread&#039;s id on every child record.<BR><BR>We perform some outragous recursion with COM objects in our software. Trying to recursively go back up the hierarchy with database queries is gonna be rough.<BR><BR>If you have the original thread id on every child record, it is much faster to a group of children all the way down to a specific child.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•