Days till birthday

Support for our integrated Contact Manager, Calendar, and Project Tracker.
Posts: 18
Joined: Sun Dec 12, 2010 11:17 pm
PostPosted: Wed Jan 26, 2011 5:13 am
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.
Posts: 18
Joined: Sun Dec 12, 2010 11:17 pm
PostPosted: Thu Jan 27, 2011 10:42 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 )
)
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Fri Jan 28, 2011 3:35 pm
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

Return to SeedCode Calendar

Who is online

Users browsing this forum: No registered users and 3 guests

(855) SEEDCODE
[email protected]
Follow us: