Jump to content

-Find with multiple values?


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

Recommended Posts

can I use -Find with more than one value for a given field?

I need to find Jobs from both Dept A and Dept B. I though it might look like this...

FMPro?-DB=Data&-Format=thisView.html&-Max=all&-Lay=List_View&Dept=A&Dept=B&-Script.presort=Sort&-Find

I get an error saying no records were found but if I search for each item it works fine.

Any help would be great.

------------------

Thanks,

G

Link to comment
Share on other sites

quote:

Originally posted by Keith M. Davie:

Search and read: Article Number: 104829, and Article Number: 105687

Peace

Keith M. Davie

Maybe I wasn't clear. Those articles are for exact match finds. I have six records. 3 of the records have "A" for field "Dept". The other 3 have "B" for field "Dept". Now there are many other records in the database like Dept C and Dept D but I only want A and B. How do I use the find command to do this?

------------------

Thanks,

G

Link to comment
Share on other sites

quote:

Originally posted by Simon Pennington:

ry adding in -LOP=or and this should find them all.

at the moment it is looking for -lop=and i believe and this says it needs records with both a and b in them

Simon

Thanks that works great!

------------------

Thanks,

G

Link to comment
Share on other sites

Still Confused!

If I use a hidden field with -lop =or and I use multiple check boxes for dept I get all records when only a+b are checked. If I check just a I get all records.

If I use a hidden field with -lop =and and I use multiple check boxes for dept I get an error saying no records found. If I check just a I get all records for dept a.

So how can I get records for a+b using the -lop tag to find values entered into multiple check boxes?

Link to comment
Share on other sites

Day 8...

Nearly convinced this cannot be done. THe natives speak of the great LOP god. I am building a ring of fire around the Web Companion machine and perform the sacred "Dance of the -LOP" in hopes of creating visions of code that will help. Hope of rescue is dwindling. I may be stuck here for a long time.

Link to comment
Share on other sites

Day 9...

Natives are nowhere to be found. In the night I had a dream with visions of exact matches but then the devil showed up and it tunrned into a nightmare. While performing the "Dance of Fertility" I knocked over the Web Companion Machine and it landed in the ring of fire. All hope is lost. Death awaits. I hope the gods are merciful.

Link to comment
Share on other sites

I still don't get it. I need to search a database of jobs and find Jobs A and B whose field "Done=no". There are other jobs in the system like C, D, E. I only want A + B. How do I do this? My code is below...

-----------------------------

<form name="form" method="post" action="FMPro">

<tr bgcolor="#FFFFFF">

<td width="245" valign="middle"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1">

</font>

<table width="100%" border="0">

<tr> [FMP-ValueList: Dept, List=DeptWeb]

<td width="20%">

<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">

<input type="checkbox" name="Dept" value="[FMP-ValueListItem]">

</font></div>

</td>

<td width="80%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">

[FMP-ValueListItem]<br>

</font></td>

</tr>

[/FMP-ValueList]

</table>

<div align="center"><br>

<input type="hidden" name="Done" value="==no">

</div>

</td>

<td width="255">

<input type="hidden" name="-db" value="Job_Tracker">

<input type="hidden" name="-lay" value="Layout24">

<input type="hidden" name="Dept" value="==">

<input type="hidden" name="-Sortfield" value="Upcoming_active">

<input type="hidden" name="-Sortfield" value="Job_Tracker_Campaigns::Year">

<input type="hidden" name="-Sortfield" value="Job_Tracker_Campaigns::Month">

<input type="hidden" name="-Sortorder" value="custom=Month">

<input type="hidden" name="-Sortfield" value="Campaign">

<input type="hidden" name="-Sortfield" value="Hit Date">

<p align="left"> <font face="Arial, Helvetica, sans-serif" size="1">Show

Results for:</font> <br>

<select name="-format">

<option value="thisweekView.html" selected>This Week</option>

<option value="nextweekView.html">Next Week</option>

<option value="listView.html">All Dates</option>

</select>

<p align="left">

<input type="hidden" name="-LOP" value="or">

<input type="submit" name="-find" value="Go">

<input type="reset" value="Reset" name="reset">

</td>

</tr>

</form>

------------------------------

Link to comment
Share on other sites

Try rearranging code in a couple of places as follows:

<form name="form" method="post" action="FMPro">

<tr bgcolor="#FFFFFF">

<td width="245" valign="middle"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1"></font>

<table width="100%" border="0">

<tr> [FMP-ValueList: Dept, List=DeptWeb]

<td width="20%">

<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">

<input type="hidden" name="Dept" value="==">

<input type="checkbox" name="Dept" value="[FMP-ValueListItem]"></font></div> </td>

<td width="80%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">

[FMP-ValueListItem]<br></font></td> </tr>

[/FMP-ValueList]

</table>

<div align="center"><br>

<input type="hidden" name="Done" value="==">

<input type="hidden" name="Done" value="no">

</div>

</td>

<td width="255">

<input type="hidden" name="-db" value="Job_Tracker">

<input type="hidden" name="-lay" value="Layout24">

<!--(input type="hidden" name="Dept" value="==") this line of code placed above delete from here-->

<input type="hidden" name="-Sortfield" value="Upcoming_active">

<input type="hidden" name="-Sortfield" value="Job_Tracker_Campaigns::Year">

<input type="hidden" name="-Sortfield" value="Job_Tracker_Campaigns::Month">

<input type="hidden" name="-Sortorder" value="custom=Month">

<input type="hidden" name="-Sortfield" value="Campaign">

<input type="hidden" name="-Sortfield" value="Hit Date">

<p align="left"> <font face="Arial, Helvetica, sans-serif" size="1">Show Results for:</font> <br>

<select name="-format">

<option value="thisweekView.html" selected>This Week</option>

<option value="nextweekView.html">Next Week</option>

<option value="listView.html">All Dates</option>

</select>

<p align="left">

<input type="hidden" name="-LOP" value="or">

<input type="submit" name="-find" value="Go">

<input type="reset" value="Reset" name="reset">

</td>

</tr>

</form>

Hope this solves the problem.

Peace

Keith M. Davie

Link to comment
Share on other sites

No Dice. Your suggestion finds all jobs where done = no.

Maybe I should simplify things.

Records contain following fields

"Dept" may contain A, B, C, or D

"Done" may contain yes or no

"upact" may contain upcoming or active

How do I find all jobs in "Dept" A whose "Done" is no and whose "upact" is active?

A find like this is so simple in FMP. I refuse to belive that it can't be done in CDML.

[This message has been edited by spragueg (edited January 29, 2001).]

Link to comment
Share on other sites

When using -LOP or/and how do you know whick field it applies to? I was assuming the order you use them?

Like

<input type="hidden" name="Done" value="no">

<input type="hidden" name="-LOP" value="and">

<input type="hidden" name="Dept" value="A">

<input type="hidden" name="-LOP" value="or">

<input type="hidden" name="Dept" value="B">

But this will not work. It says no records found. There are records in the database where Dept = A or B and Done = No. Am I an idiot? Why is this so difficult. Can someone please explain the -LOP or/and and the proper usage? I cannot figure this out. I think I might scrap this whole thing.

G

Link to comment
Share on other sites

It may be that you have to first perform a find of Dept A, and then a separate find of Dept B, using an exact search for each dept. If an "-error" format file results from the search of A, allow for the search of B to be performed from there. And if the search of A is successful, allow for a search of B from the results.htm. You might also provide a pop-up menu for the Departments (select dept., click "go").

Also I note that in your code you have "&-script.presort=sort". If you are running a cdml -script tag in conjunction with ScriptMaker

Link to comment
Share on other sites

In FMP 4 you get one token, in FMP 5 you get up to 10 tokens. There are a lot of other things which can be captured, fields, recids, etc. Pass those items either directly or through tokens, capture them and use them in your code as required/needed.

You have three criteria in your search. Two constant search requirements and a variable - Dept A, B, C or D.

The exact search of the two criteria with Dept. A will allow certain items to be passed to an error page and even more items to a success page which will allow those passed items to be used with the two criteria and Dept. B.

If you do not understand the passing of various things, I would suggest you review my demonstration which I have offered elsewhere in this forum. I am looking for users which can provide me with their take on its usefulness once they have had a chance to digest it. Unfortunately it was constructed with -script used in several spots. If you can ignore the -script usage, you will get a lot about the rest of what is offered, including a Developer's Tool.

Link to comment
Share on other sites

I stopped using the -script.presort tag shortly after that post. I am now tring to do the find with CDML alone. How would I keep track of the found sets. How do you do two seperate finds and keep them for seaching against in CDML? I know how to do this in filemaker but using CDML is rather new to me.

Link to comment
Share on other sites

This topic is 8573 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.