February 22, 200223 yr Hope someone can help me here!! We have a field with the birthday of a person. We need to determine his age today! I am not sure of the calculation to use because of leap years and such.. any help would be greatly appreciated.. Thanks Stu
February 22, 200223 yr Newbies Stuj, There may be an easier solutions, but I quickly tested this and it worked. 1. Create a calculation field c_bday. code: Year(birthday_field) 2. Create a calculation field c_today. Use the 'Today' from the Date Functions menu and make sure the output of this field is TEXT. 3. Create a calculation field c_age. Use code: If(Left(bday_text, 5) <= Left(c_today, 5), Right(c_today,4) - Right(bday_text,4),Right(c_today,4) - Right(bday_text,4) - 1) Hope this helps, Tim [ February 22, 2002, 09:46 AM: Message edited by: autdesign ]
February 22, 200223 yr FileMaker.com has an article about this. Click here. Note: the article does caution the use of the Today function, but for some reason, doesn't mention Status(CurrentDate) as an alternative -- it's generally a much better way to go.
February 22, 200223 yr It may have been written before a version of FileMaker came out with Status functions. The only real problem with the Today function is that is only evaluates when FileMaker opens the file, so if the file is left open overnight, Today won't return the correct date. Status( CurrentDate ) doesn't have this limitation. FileMaker has kept the Today function around for backwards compatibility. Chuck
Create an account or sign in to comment