Parent Child Relationship, HowTo Calculate Child Qty

HELP!!!! Need help regarding the following

I have an x(0 to 9), y(0 to 9), z(0 to 9) arrry

array x contains parent IDs
array y contains child IDs
array z contrains Child ID Quantities

This problem is a tree problem it goes up to five levels

x(0) = 13466: y(0) = 13464: z(0) = 2
x(1) = 13489: y(1) = 13466: z(1) = 3
x(2) = 13593: y(2) = 13466: z(2) = 4
x(3) = 13536: y(3) = 13489: z(3) = 1
x(4) = 13595: y(4) = 13593: z(4) = 1
x(5) = 13884: y(5) = 13593: z(5) = 1
x(6) = 31988: y(6) = 13536: z(6) = 2
x(7) = 31988: y(7) = 13595: z(7) = 1
x(8) = 31988: y(8) = 13884: z(8) = 1
x(9) = 31744: y(9) = 31988: z(9) = 1

Lowest child is '13464' it has 1 parent '13466' which in turn has 2 parents like wise

The total quantity of child '13464' is = 28 when calculated manually

Can someone please provide me with a sub routine to programatically find the total quantity of child ID '13464' either in vb or c

Thanks a bunch!

Murgan

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories