jrRaid Posted February 5, 2008 Posted February 5, 2008 It's strange but I can't get my head around this. In a table (A) I have a numberfield with the age of a person (age). In another table (: I have records with two numberfields: minAge (minimum Age) maxAge (maximum Age) I need to find in table ( all the records where the 'age' from table A falls between minAge - 5 years and maxAge + 5 years. I start my script from table A where I set a variable $age to 'age'. Go to table B Enter find mode set field minAge > $age -5 ... and now I'm stuck... set field maxAge < $age+5 Perform find doesn't give the right result. What do I miss here ? TIA
Fitch Posted February 5, 2008 Posted February 5, 2008 Where you set the minAge field, do it like this: ">" & $age - 5
jrRaid Posted February 5, 2008 Author Posted February 5, 2008 Thanks Fitch. Must be the frustration. but that is the way I have it. The problem is that if f.i. there is a record in B with minAge 21 and maxAge 28 and a second one with minAge 22 and maxAge 33 and the age in A is 23, the search result should be the two records. It only gives 1 record. When I do the search manually in B I get the two records. With the script not...
_henry_ Posted February 5, 2008 Posted February 5, 2008 Hi JrRaid, Could you please specify how you will do manually the search?
jrRaid Posted February 5, 2008 Author Posted February 5, 2008 Thanks _henry_, where was I all that time. The second line should be: SetField(maxAge); ">="&$age +5 to have the the table A age between the table B min/max range. It's not a bad idea to take some distance for a few hours, return to the file, try again and THEN post a question....if need be....
_henry_ Posted February 5, 2008 Posted February 5, 2008 Hi again, So, that's good finally you figured it out :B
Recommended Posts
This topic is 6137 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