Jump to content
Salesforce and other SMB Solutions are coming soon. ×

age calculator


greg08
 Share

Recommended Posts

I'm new to filemaker and need help with an age calculator.

seems easy enough and probally is but i cannot get it to work correctly

 

age = get((CurrentDate) - Birthdate) / 365

 

returns something like 4.xxxxxxxx

can I not show the decimals some how ( ive tried a couple of ways)

or is there a correct script that im not using

 

I Came across this post with code in a post:

 

Year(Get(CurrentDate)-Birthdate) -1

 

If I was born on 03/30/2000 and todays date is 03/30/2006 I should be 6 years old. The script returns 5. If same birthdate and todays date is a day earlier, all is correct. I guess technically the script is correct in that if someone is born today they are not a day old until a day after their birthday.

Is there anyway to correct it.

Link to comment
Share on other sites

if someone is born today they are not a day old until a day after their birthday.

 

Exactly (well, almost exactly: you ARE a YEAR old ON you birthday. But the principle is correct). So:

 

Let (

today = Get (CurrentDate)

;

Year (today) - Year (Birthdate) - ( today

)

 

 

P.S. Technically, we are talking about a calculation, not a script.

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use