Here is a calculation I use for working out someone's age, just create a calculated field and change the references to Birthday
Year ( Get ( CurrentDate ) ) -
Year ( Birthday ) - Case ( Get ( CurrentDate ) <
Date ( Month ( Birthday ) ; Day ( Birthday ) ; Year ( Get ( CurrentDate ) ) ) ; 1 ; 0 )
Also under storage options set it to Do not store calculated result.
This uses the Get ( CurrentDate ) function so there is no need for any additional field with the current date.
I hope this helps.
The following will give you age in years:
You take the integer portion of the difference between the current date and the birthday divided by the average number of days per year.
Thank you both for such a quick reply.
I will give them both a try.
I feel that this type should be a canned script, I'm sure that it would get
a lot of use.
Your fix worked just fine.
I found and have used this:
//calculates age in years
I am glad to have found this page when I was looking for a script for birthday. Only as I read through the replies did I realise the "Get" function in FM10 pro. With that in hand, I wish to share my script which I hope would be useful to others as well.
Round ( (Get ( CurrentDate ) - Birthday) / 365 ; 0 )