Jump to content

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

Recommended Posts

  • Newbies
Posted

 i´ve got this in the filemaker´s site to know the ages of my contacts (i´m learning to use LET function):

Let ( [ T = Get ( CurrentDate ) ; YT = Year ( T ) ] ;
YT - Year ( birthdate ) - ( T < Date ( Month ( birthdate ) ; Day ( birthdate ) ; YT ) ) )

what i did before was:

Let ( [ T = Get ( CurrentDate ) ; YT = Year ( T ) ] ;
If (
T < Date ( Month ( birthdate ) ; Day ( birthdate ) ; YT ) ; 
YT - Year ( birthdate ) - 1 ;
YT - Year ( birthdate )
)
)

both of them work perfectly


someone can help me to understand this: 
YT - Year ( birthdate ) - ( T < Date ( Month ( birthdate ) ; Day ( birthdate ) ; YT ) ) )

Posted

The expression in parentheses:

T < Date ( Month ( birthdate ) ; Day ( birthdate ) ; YT ) 

is a comparison; it returns 1 when true, 0 when false. So subtracting this from the difference between years accomplishes the same thing as your If() construct does. This has nothing to do with the Let() function.

  • Like 1
  • Newbies
Posted

The expression in parentheses:

T < Date ( Month ( birthdate ) ; Day ( birthdate ) ; YT ) 

is a comparison; it returns 1 when true, 0 when false. So subtracting this from the difference between years accomplishes the same thing as your If() construct does. This has nothing to do with the Let() function.

Thank you, so much!

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