August 9, 200520 yr i initially posted a faulty script of mine here: faulyt script all the help i got before took me through extra steps and having to make new fields, which wasn't what i was looking for so i sat down racked my brain and found my own answer: a script to do a "search" for two or more possible values in a single field: go to record/request/page [first] loop if [table::feild = X xor table::field = Y] go to record/request/page [next;exit after last] else omit record go to record/request/page [first] end if end loop thats it what do you guys think?
August 9, 200520 yr Author now how come the script worked in my practice data base but as soon as i put it in the one i'm working on it stops working....nothing like a good foot in your mouth to haly progress for the day *edit* heh over reacted a simple misplaced underscore Edited August 9, 200520 yr by Guest
August 9, 200520 yr thats it what do you guys think? Whats wrong with:? Enter Find Mode Set Field[table::field; X] New Record/Request Set Field[table::field; Y] Perform Find
August 9, 200520 yr A record in which the field contains both X and Y would be found by the two find requests method but not by the xor method
August 9, 200520 yr Maybe I misundertstood the inital post. If I had a Table with a field named Fruit. Record 1 Fruit = Apple Record 2 Fruit = Apple ¶ Orange Record 3 Fruit = Orange The original poster is looking for a way to find records 1 & 3 but not record 2? In which case: Enter Find Mode Set Field[table::field; "==" & X] New Record/Request Set Field[table::field; "==" & Y] Perform Find
August 9, 200520 yr SlimJim refered to a case where a text field may CONTAIN "apple" or "orange" or both. Which is easily solved by: Enter Find Mode Set Field [ table::text ; "apple" ] New Record/Request Set Field [ table::text ; "orange" ] New Record/Request Set Field [ table::text ; "apple orange" ] Omit Record Perform Find
August 10, 200520 yr I did some minimal testing on this with, to me at any rate, a surprising result. Suppose we have six records with the following contents in a text field Apple Apple Orange Apple Pear Pear Orange Apple Orange The script method choses records 1,5 and 6, which I thought was surprising. The "xor" seems to apply an exact match in the Apple, Orange and if you replace it with an "or" it produces the same result - records 1,5 and 6. If you replace it with "and" you get no results (and an endless loop). Similarly if you replace it with "and not" you just get the two records with Apple. The finds behave pretty much as expected. The first sbg2 find finds all the records The second sbg2 find finds records 1,5 and 6 The Comment find finds records 1, 3 ,4 ,5, 6. Conclusion. It would appear that If(field="Apple") only returns true if field exactly equals "Apple" whereas the find field = "Apple" returns true if Apple is contained in the field. (I guess the find is on the index of the field)
August 10, 200520 yr A default find finds WORDS that start with specific characters. There is no "=" in a default find.
August 10, 200520 yr New Record/Request Set Field [ table::text ; "apple orange" ] Omit Record Perform Find Huh? I completely missed the Omit Record step when reading your reply. Never realized this worked to constrain a found set, glad you posted that.
August 11, 200520 yr Author you guys all kinda missed the point in one field you could have values a,b,c,x,y,z but i only wanted to find records that in that field had x or y
August 11, 200520 yr In your original post you used the xor operator. Which led us to believe you wanted to find records that in that field had x or y - but not both. That is what my find does. If you want to find records that in that field have either x or y, including both, use sbg2's method.
Create an account or sign in to comment