Jump to content

Two calculations for one field


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

Recommended Posts

Hi

I have a field, that returns a calculated value for a person’s age, using the calculation:

(Date of procedure - Date of birth) / 365

I would like the number in the age field to turn (for example) red if the persons age is over 70 yrs old, or under 1 year old.

I have tried adding:

Case (persons age>70; TextColor (persons age ; RGB (255 ; 0 ; 0 ) ); Evaluate ( persons age ) )

But my attempts fail, mostly FileMaker says there is a “operator missing”

Could someone please help with the next step to follow my existing calculation?

Thanks

Link to comment
Share on other sites

How about simply:

Let (

age = ( Date of procedure - Date of birth ) / 365

;

Case ( age < 1 or age > 70 ; TextColor ( age ; RGB ( 255 ; 0 ; 0 ) ) ; age )

)

BTW, to calculate the approximate age you should use 365.2425 instead of 365 (leap years!) - or use the formula here to determine the exact age:

http://www.fmforums.com/forum/showpost.php?post/150446/

Link to comment
Share on other sites

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