5 Replies Latest reply on Nov 18, 2009 11:06 AM by philmodjunk

    Found contacts and omit them

    techccaq

      Title

      Found contacts and omit them

      Post

      Hello,

       

       

      I have 100 contacts.  Each contact have some activities associated to him.

       

      I would like to know how to find, in the 100 contacts, which person does not have a particular activities.

       

      My table name for customers is customers.  Another table is called activities.  I also have another table called order_lines.

       

      The order_lines table contains all the activities that all customers have.

       

       

      Thanks for you help

       

       

        • 1. Re: Found contacts and omit them
          philmodjunk
            

          The simplest way to find records that "do not have" specified data is:

           

          Enter find mode

          Enter the "do not have" criteria

          click the Omit button in the status area (tool bar)

          perform the find.

           

          I can't give a more specific suggestion without a more detailed description of your issue. If the above advice doesn't work, perhaps you could post an example.

          • 2. Re: Found contacts and omit them
            techccaq
              

            Hello,

             

            You have completely right.  Unfortunately, the tables orders_lines contains all activities for each users.  But, Some users could'nt have the activities that I search for.  So, I should search for all my customers in tables customers (100).  Then, I should check all customers which have the activities I search.  Your post could help me with that.  After all, I should find the difference between the numbers of customers and all the customers that don't have the activities.

            • 3. Re: Found contacts and omit them
              philmodjunk
                

              I can't tell from your posts exactly what type of search you are trying to do and that leaves me guessing as to what you are trying to do.

               

              If you need to find all records that do not have any related records in a given table you can use this method to search for them:

               

              Define a calculation field in the parent table cChildCount : Count(Childtable::nonBlankField)

              Clear the "do not evaluate if all fields are empty" check box. Now you can enter a zeror in the cChildCount field and find all records in the Parent table that do not have related records in the child table.

               

              If this isn't what you are trying to do, please give an example with the actual criteria you are entering and if there is more than one table involved, please describe exactly the relationship between your tables.

              • 4. Re: Found contacts and omit them
                RSchaub
                   How about a relationship and use Go To Related Records [Show related records only]
                • 5. Re: Found contacts and omit them
                  philmodjunk
                    

                  RSchaub wrote:
                  How about a relationship and use Go To Related Records [Show related records only]

                   

                  That approach must be used with care and you often have to check for the related records with either Isempty(relatedtable::keyfield) or Count(Relatedtable::keyfield) anyway.

                   

                  Check this thread for more on Go To Related Records:

                   

                  The Complete Go To Related Record