Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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 (:B 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

Posted

Where you set the minAge field, do it like this:

">" & $age - 5

Posted

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...

Posted

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....

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 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.