Jump to content
Server Maintenance This Week. ×

Logical operators in compound find request


This topic is 3381 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hello -

Has anyone had any luck using logical operators in a compound find request? For example, here's a simple request (just for testing purposes):

http://localhost/fmi...mresultset.xml?

–db=Data_Libraries&

–lay=web_Reports&

–query=(q1,q2);(q3);!(q4)&

–q1=pt_Name_First&

–q1.value=Andrew&

–q2=pt_Name_Last&

–q2.value=Schools&

–q3=pt_Social&

–q3.value=1234567890&

–q4=caseType&

–q4.value=TEST&

–findquery

The request above searches for a patient with a first name of "Andrew", a last name of "Schools" and who has a social security # of "1234567890". It's omitting any results that have a caseType with a value of "TEST".

What I would really like to do is use the "cn" logical operator for both the first and last name so someone can search for "and" and that would find any records with the first name LIKE "and". I've already tried several different ways of adding logical operators like:

–q1=pt_Name_First&

–q1.value=Andrew&

–q1.op=cn&

AND

–q1.cn=pt_Name_First&

–q1.value=Andrew&

But the examples above do not work. I can't use a plan old find request because I'm going to need both "AND" and "OR" logical searches in the same find request. For example, I have a value that will need to be searched accross multiple fields so that will require an OR LIKE clause.

I've been playing around with it for most of the day. Took a whole 10 minutes to construct the SQL for the ODBC driver I built but when it comes to this FileMaker PHP API, nothing is fast...

Any help will be appreciated.

Andrew Schools

Small Business Computers of New England

Link to comment
Share on other sites

  • 6 months later...
  • Newbies

I am also keen to understand how I represent this sort of search pattern in php, using the AddFIndCriterion call. I have been unable to find any documentation on it at all, except one example:

AddFIndCriterion("Numeric Field Name","<100")

Which did not work on my installation (V12). The Criterion field seems to only take a raw pattern, which it looks for in the specified field.

Anyone got any info?

Link to comment
Share on other sites

By default FileMaker actually uses a op=bw search, so putting "and" in should find Andrew. Or you can play with the input from a form before running the search to do "and*" which will force that behaviour...

Cheers

Webko

Link to comment
Share on other sites

  • 2 years later...

But what about a search request that includes a logical AND and a logical OR? Is that even possible, been looking for a solution for this for days now....

 

Example:

 

AND

$request1 = $fm->newFindCommand($layoutName);
$request1->addFindCriterion('rID', $KlantNummer);
 
+OR
$request2 = $fm->newFindCommand($layoutName);
$request2->setLogicalOperator(FILEMAKER_FIND_OR);
$request2->addFindCriterion('ID', $search);
$request2->addFindCriterion('FullName', $search);
Link to comment
Share on other sites

This topic is 3381 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.