AnsweredAssumed Answered

Find Records in one table that don't exist in a 2nd table

Question asked by cynthiablue on Jan 1, 2018
Latest reply on Jan 2, 2018 by greatgrey

I have a List View Layout and I'm trying to display all the people and dogs that are entered into my Current Event, and exclude the ones that are not entered into the Current Event. I'm trying to do this with a Find Script on Layout Enter.


The Layout is based on my Dog Table, which is joined to my Run table.  Dog has the Primary Key (__pkDog), Run has the Foreign Key (__fkDog).  (Dog::__pkDog = Run::__fkDog) The Run Table also has a field that states which Event it is in, which is joined to the CurrentEvent table.

(CurrentEvent::__pkCurrentEvent = Run::__fkCurrentEvent). 


I'm listing all the dogs in the Dog table.  If the dog does not exist in the Run table for the Current Event, I don't want to display the dog in the Layout.  I usually step backwards when I'm having problems, so at this point, I'm just trying to do a find on All Dogs that have a record in the Run table (and I can add in Current Event later).


I'm having a hard time figuring out how to do this with a Find step in the script.  I want to display all dogs that do have a corresponding record in the Run Table.  If it does not have a corresponding record in the Run Table, I don't want the dog to display.  I'm not sure how to tell the Find how to omit records that don't have a corresponding record in the Run table.  I'll play with it some more.  Sometimes writing it out helps me think.  Thanks!