0 Replies Latest reply on Feb 12, 2012 7:24 PM by AnoopMehta

    Simple search

    AnoopMehta

      Title

      Simple search

      Your post

       Hi

      Current situation: trying to search a database for Level = A and Step 2. my code shows me all the records with A. I want it to show only one record with A and 2.

      e.g. output

      A 1 58300 57157 261
      A 2 61384 60180 261
      A 3 64498 63233 261
      A 4 67614 66288 261
      A 5 70144 68769 261
      A 6 72675 71250 261
      A 7 75206 73731 261
      A 8 77733 76209 261

      I just want

      A 2 61384 60180 261

      the code is as follows:

       //  Create the Compound Find command object    

       $compoundFind =& $fm->newCompoundFindCommand($layoutName);    

      // Create all find requests    

      $findreq1 =& $fm->newFindRequest($layoutName);    

         

      // Specify search criterion for each find request    

      $findreq1->addFindCriterion('level', 'A');    

        

      // Add find requests to compound find command    

      $compoundFind->add(1,$findreq1);    

          

      // Set sort order    

      $compoundFind->addSortRule('level', 1, FILEMAKER_SORT_ASCEND);         

      // set skip and max values    

      $compoundFind->setRange(0, 50);         

      // Execute compound find command    

      $result = $compoundFind->execute();         

      // Get records from found set    

      $records = $result->getRecords();