3 Replies Latest reply on Oct 27, 2012 3:04 PM by ChrisSmythe

    Table / Field Comparison

    ChrisSmythe

      Title

      Table / Field Comparison

      Post

           Hello, I am using FileMaker Pro 12 on Windows XP.

           I am hoping someone would please be kind enough to help me with the following FileMaker Table/field comparison:

           I have a link to my Test 11.fmp12 database (Account Name: Admin & Password: "there is no password" just click OK.

           https://www.sugarsync.com/pf/D0681807_60165357_21551

           I need a script to compare the following fields within the following two tables:

           DbUserEdits table --- LinkToEmployeeID field; and
           Personnel table --- EmployeeID field.

           If there is no matching record with a LinkToEmployeeID field in the DbUserEdits table with a corresponding EmployeeID field in the Personnel table, then
           the record associated with the LinkToEmployeeID field needs to be deleted from the DbUserEdits table.

           I hope this makes some sort of sense - I am a newbie.

           Any help would be greatly appreciated.

           Kind regards,

           Chris :)
            

        • 1. Re: Table / Field Comparison
          philmodjunk

               So you have this relationship:

               DBuserEdits::LinkToEmplyeeID = Personnel::EmployeeID

               You want to delete all records in DBuserEdits that do not have at least one related record in Personnel.

               Go To Layout [DBuserEdits]
               Enter FInd Mode []
               Set Field[Personnel::EmployeeID ; "*" ]
               Omit Record
               Set Error Capture [on]
               Perform Find[]
               Pause/Resume [Indefinitely]
               Delete All Records

               The Pause step is not stricly needed, but allows you to inspect the records found and to cancel if they are not the ones you want to see deleted.

          • 2. Re: Table / Field Comparison
            Sorbsbuster

                 @Phil - do you see any functional or performance difference in using Omit = "*" over Find "="?

            • 3. Re: Table / Field Comparison
              ChrisSmythe

                   Thank you PhilModJunk and Sorbsbuster for all your excellent help - very much appreciated.

                   Kind regards,

                    

                   Chris :)