tomr40 Posted July 31, 2006 Posted July 31, 2006 I have a database of Driver Ed students. I need a formula for a calculation field that will calculate the student's age in years on the last day of class for their session. The database already has a field for "birthdate" (ex 11/06/1991.) It has a field for "session" (ex Session 1, Session 2, etc). It has a calculation field for "date of last class" (ex if the session = Session 1 then the last day of class is 9/30/2006. If the session = Session 2 then the last day of class is 11/28/2006, and so on) For example, if the student with the 11/06/1991 birthdate takes the Session 1 class he will be 14 on the last day of class. If he takes the Session 2 class he will be 15 on the last day of class. Therefore, I'm looking for a calculation field formula that will give me age in years given a birthdate and Session #. Thanks in advance for any help you can give me
Bailey Kessing Posted August 1, 2006 Posted August 1, 2006 Here is a custom function I wrote. //form: years ( date1 ; date2 ) If(not IsEmpty(date1) and not IsEmpty(date2); Abs ((GetAsDate(date2) - GetAsDate ( date1)))/365.25;"")
Lee Smith Posted August 1, 2006 Posted August 1, 2006 Are you really using FileMaker v4? If so, then you can not use a Custom Function. Although, in this case it isn't needed. The question on how to figure ages, or the elapsed days between two dates, comes up from time to time. If you do a search for [color:blue]+Birthday +Calculation (using the [color:blue]pluses as shown), you should come up with lots of examples. If you are using version 4 as you stated, then you will need to replace the [color:red]Get (CurrentDate) or [color:red]Status (CurrentDate) with your [color:red]Session Date. HTH Lee
Fitch Posted August 1, 2006 Posted August 1, 2006 Adapted from the FileMaker knowledge base ( www.filemaker.com/kb/ - search for "age") Year (date of last class) - Year (birthdate) - Case( date of last class < Date (Month (birthdate); Day (BirthDate); Year (date of last class)); 1; 0 )
Recommended Posts
This topic is 6751 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now