Hi Evertone
What calculation could I use to find how many days to a persons birthday using the feild DOB, making sure that it alters as each new day happens.
Thanks again
Milton.
Days till birthday
3 posts
• Page 1 of 1
Posts: 18
Joined: Sun Dec 12, 2010 11:17 pm |
|
Posts: 18
Joined: Sun Dec 12, 2010 11:17 pm |
Hi All,
I have tried using the following which works succesfully, but I would like it to change dynamically when the date changes, so that when a user checks the staff members page it will give an updated days till their birthday TIA Milton /* ---------------------------------------------------------- Returns the number of days to the next birthday Return type: Number Syntax: NextBirthday ( birthdate ) DaysToNextBirthday ( birthdate ) returns 300 when birthdate contains April 12, 1957 and today is June 16 2005. Theo Ros ----------------------------------------------------------*/ Let ( now = Get ( CurrentDate ) ; Case ( Date ( Month ( DOB ) ; Day ( DOB ) ; Year( now ) ) <= now ; Date ( Month ( DOB ) ; Day ( DOB ) ; Year ( now ) + 1 ) - now ; Date ( Month ( DOB ) ; Day ( DOB ) ; Year ( now ) ) - now ) ) |
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am |
Make that calc unstored and you should have what you need: it will reevaluate every time it needs to, though you sometimes need to open and close FileMaker in order for it to see that it is now "tomorrow".
John Sindelar
SeedCode |
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests