• nutty (11/21/2013)


    Yes it does match what I want as output.

    However the trouble is, these child codes are common codes for various other parent codes.

    For example two different parents can share the same child codes and I have to find out which child code belongs to which parent and the only way i can do is through the account no because account nos will be different for each set of parent and child.

    Am I clear this time? sorry to confuse you

    Ah. Understood. Add some data to the test data generation code on this thread and post it so folks can take a crack at it for you.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)