4 Replies Latest reply on May 31, 2013 7:01 AM by philmodjunk

    Finding and constraining



      Finding and constraining



           I have a join table 'contact_letter' with fk's letter_id and contact_id.


           trying to write a script to find all records in the contact_letter table that have a letter_id of x or y (user sets both when prompted) with duplicate contact_ids...

           tried a number of combinations not having any success - it's got to be easy, just can't get it

           all help appreciated

        • 1. Re: Finding and constraining

               "duplicate contact_ids"??

               Does that mean that you have duplicate contact ID values if you find a record linked to letter x and a different record linked to letter y that both have the same contact ID value?

          • 2. Re: Finding and constraining

                 Hi Phil, in a word yes...

                 a contact could be tagged to receive more than one letter, so the contact_letter table could have two records, one linking say contact_id 12345 and letter_id 8, and another linking 12345 and letter_id 9.

                  what I'd like to do is find all those records that have both 8 and 9

                 the contact_letter table is in a portal on each contact's record

            • 3. Re: Finding and constraining

                   Try putting the Portal in a Layout associated with Letter's Table.  Then Find x and y from that direction.  You should get a list of Customers with X and Y.


              • 4. Re: Finding and constraining


                     Perform a find for the first letter ID on a layout based on the join table.

                     Return to find mode, specify the second letter ID, but use constrain found set instead of perform find.