pmusaev Posted October 31, 2003 Posted October 31, 2003 how do i perform an 'OR' in my find requests? i need to find a range of values in a certain field and another range within another, but they need to be related by an 'OR' statement. any ideas?
-Queue- Posted October 31, 2003 Posted October 31, 2003 If you are scripting it, then use the New Record/Request script step for each group of criteria. If you are performing them manually, use Requests->Add New Request.
pmusaev Posted October 31, 2003 Author Posted October 31, 2003 hey -Queue-, i did that mate... what i'm struggling with is this: one field needs to match a certain set of criteria, as well, another field needs to match it's own set of criteria, without the two fields depending on each other. i need to say FIELD 1 is >0 AND <0 OR FIELD 2 is >0 AND <0
pmusaev Posted October 31, 2003 Author Posted October 31, 2003 maybe it would be better to perform a FIND on a set of records that have already undergone the search procedure... how is this done?
-Queue- Posted October 31, 2003 Posted October 31, 2003 Multiple find requests are not related or dependent on each other (except for Omitted ones, which is another subject). So if request 1 is FieldA > 3 and request 2 is FieldB < 1, then any records with FieldA > 3 OR FieldB < 1 will be found. I'm not sure what you mean by 'FIELD 1 > 0 and < 0', since this is a logical contradiction and an impossibility.
pmusaev Posted October 31, 2003 Author Posted October 31, 2003 because negative values are allowed, what i'm doing is finding all fields that actually contain a value (ie. greater than 0 and less than 0). and what i'm finding is this... if request 1 is FieldA >0, request 2 is FieldA <0, request 3 is FieldB >0, and request 4 is FieldB <0 then i only get results that match all that criteria, i want results from both, so if something in FieldB does not have it's FieldA greater than or less than 0, it will not show up regardless if i want it to. make sense? cheers!
-Queue- Posted October 31, 2003 Posted October 31, 2003 Then you mean greater than 0 or less than 0. The 'and' was the part that didn't make sense. Why not just use 0 and Omit Record? This will find every record where Field is not 0. Your empirical results seem to be contrary to FileMaker's Find functionality. Multiple non-omitted requests ARE equivalent to a '1 or 2 or 3' search. I assume there's something you're not telling me that would explain this discrepancy. Using Omit, however, will narrow your requests down to two: Request1--FieldA = 0 [Omit]; Request2--FieldB = 0 [Omit]. Although, if you have fields with possibly NULL values, then you'll need to add two additional requests: FieldA = "=" [Omit], FieldB = "=" [Omit].
pmusaev Posted November 1, 2003 Author Posted November 1, 2003 ok, -Queue- i used your Omit advice (thankya!) but it's still not working. if criteria specified does not match across both fields, then some records are not displayed. ie. Request 1 - FieldA = 0 [Omit] Request 2 - FieldB = 0 [Omit] The results I get back are records where values in FieldA are NOT 0 AND values in FieldB are NOT ZERO as well as NOT ZERO in FieldA. In this case, no such records exist and I get no results back. Hope I am being clearer. Thank you for your patience!
-Queue- Posted November 1, 2003 Posted November 1, 2003 Okay, I understand your problem now. Revert to using your ">0", "<0" criteria for each field, one find request per criterion. So you'll have 4 find requests: FieldA => "<0" FieldA => ">0" FieldB => "<0" FieldB => ">0" This should work fine, and is what I was doing before your 'AND's started confusing me.
Ugo DI LUCA Posted November 1, 2003 Posted November 1, 2003 Hey there ! Advanced Find ? Really ? FM has a IsEmpty() which is pretty much answering this request too. c_checknotEmpty = not isEmpty(FieldA) or not isEmpty(FieldB) Either script a find on that field entering a "1" or show records in a portal with a relationship 1:1.
pmusaev Posted November 3, 2003 Author Posted November 3, 2003 i am using version 5.5... this isn't happening for me Queue, is that the problem? cheers.
BobWeaver Posted November 3, 2003 Posted November 3, 2003 It will work in any version 2.0 and later. Make sure that you are setting up multiple find *requests* within a single find operation, not successive find operations. Go into find mode. Enter the first criterion in field A: <0 Select menu item Requests>Add New Request Enter the second criterion in field A: >0 Select menu item Requests>Add New Request Enter the third criterion in field B: <0 Select menu item Requests>Add New Request Enter the fourth criterion in field B: >0 Click the find button (or hit enter)
-Queue- Posted November 3, 2003 Posted November 3, 2003 Oh sheesh, I didn't even think about the fact that multiple requests might be interpreted as multiple finds. Thanks for the elaboration on that, Bob.
pmusaev Posted November 5, 2003 Author Posted November 5, 2003 thank you both, it is working great now! cheers. if you don't mind, could i ask another question? i am trying to create a group of scripts that will sort by column. i will add these scripts to buttons at the top of each column. any ideas?
-Queue- Posted November 5, 2003 Posted November 5, 2003 Are you asking how to set it up? Manually perform your first sort, create a script with only Sort [Restore, No dialog]. Once you've closed the script, the sort is saved permanently. Then perform your next sort and create the next script. If you ever need to change the sort, perform another one, open the script, close it, and click the 'Replace' option for sort order. Now, apply each sort script to its relevant column button, and you're done. Does that answer your question?
pmusaev Posted November 5, 2003 Author Posted November 5, 2003 YOU ARE A GOD! thank you, you're help (and all the others on this post!!!) is greatly apprecited. thank you very much! i do not understand why my search was unsuccessful at first, seems as though i had a syntax problem. thank you all once more and i wish you the best! cheers.
Recommended Posts
This topic is 7949 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 accountSign in
Already have an account? Sign in here.
Sign In Now