5 Replies Latest reply on May 17, 2009 1:38 PM by TuxfordC

    Sorting family names for a phone book.

    TuxfordC

      Title

      Sorting family names for a phone book.

      Post

      Greetings,

                     After some 25 years working with Pascal & Delphi, I have been asked to

      update a Pro 9 database written a year or so ago. The problem is sorting first

      names in a family to create a telephone list layout for printing.  Having a 'Head of

      the household & perhaps a Spouse is not difficult. But how do I collect the first

      names of any children - or other relations - to place them in a comma separated line

      beneath the 'parents'?  A calculation, a script, or what?

       

      Thanks,

      TuxfordC.

        • 1. Re: Sorting family names for a phone book.
          mrvodka
             I probably would recommend a calculation, but its hard to advise without knowing your structure. How do you have the family related right now?
          • 2. Re: Sorting family names for a phone book.
            TuxfordC
              

              I have created a unique family_name field that appears in the records of all family members resident

             at that address/phone number.

            • 3. Re: Sorting family names for a phone book.
              KIDO
                 <!--            @page { margin: 2cm }           P { margin-bottom: 0.21cm }        -->

              I would suggest a calculation, or a calculation in a script:

               

              Substitute ( your text; family name field; “” )

              will remove every instance of your family name in the field. If you do not wish to alter your field contents, use it with a variable in a script to pass the result to where you need it.

               

              Regards

               

               

              • 4. Re: Sorting family names for a phone book.
                LaRetta_1
                  

                I would handle it a bit differently ...  Since you have a unique family_name field to 'group' all family members, I would create another table occurrence of this table and join Main::unique_family_name = selfjoin::unique_family_name.

                 

                You can then create a calculation in your main table (result is text) with:

                 

                Substitute ( List ( selfjoin::FirstName ) ; ¶ ; ", " )

                 

                This will produce a list of all family member's first names, separated by a comma.

                 

                UPDATE:  You should be using a unique ID to identify each family group.  And it also suggests your structure might warrant a second table (one table called Family and the second table called Members), joined on this unique FamilyID.

                • 5. Re: Sorting family names for a phone book.
                  TuxfordC
                    

                  Thanks KIDO and LaRetta.  I guess that my main problems are unfamiliarity with FM, and being

                  asked to update a program written by someone else. I don't know why he did certain things.

                  I'm still getting to grips with the many related tables - including separate ones for Family

                  and individuals and am really missing the Repeat/Until  and While/Do procedures that I used

                  previously.

                   

                  TuxfordC.