Jscott Posted January 23, 2006 Posted January 23, 2006 I am using this calculation to determine the age of an individual, but what I need to do is to compute the age using the Date of Birth from the Date of Death.. I replaced the [color:blue]now = Get ( CurrentDate ) ; with the DATEOFDEATH field, but an erronous answer. Just can't seem to put my finger on what I am doing wrong. Let ( [ now = Get ( CurrentDate ) ; b = DOBdateField ] ; Year ( now ) - Year( b ) - (( Month ( now ) + Day ( now ) / 100 ) < ( Month ( b ) + Day ( b ) / 100)) )
Lee Smith Posted January 23, 2006 Posted January 23, 2006 What do you want the results to look like. 50 49 years, 11 months, 17 days, 49 years Or something else. Lee
Jscott Posted January 23, 2006 Author Posted January 23, 2006 Years, Months and Days would be great.... Thanks Lee
Lee Smith Posted January 23, 2006 Posted January 23, 2006 (edited) Here is a Custom Function that will do that: Click Here There are also a ton of example of age calculations around this Forum also that are not Custom Functions. HTH Lee Edited January 23, 2006 by Guest test
Jscott Posted January 23, 2006 Author Posted January 23, 2006 Having problems with this calc... Let ( leapFactor = If ( Mod ( Year ( DEATHDATE ) ; 4 ) = 0 ; 1 ; 0 ); Case ( // Age in years Format = 1 ; Year ( DEATHDATE ) - Year ( BIRTHDATE ) - ( ( DayOfYear ( DEATHDATE ) - leapFactor ) < DayOfYear ( BIRTHDATE ) ); What am I doing wrong? The Age field just shows a ?
Jscott Posted January 23, 2006 Author Posted January 23, 2006 No it is a calculation and the result is set to Number...
Lee Smith Posted January 23, 2006 Posted January 23, 2006 The calculation contains is text, so change it from the default of Number to Text. Lee
Jscott Posted January 23, 2006 Author Posted January 23, 2006 Lee, I just cannot get it to work... I have attatched what I have done. Maybe you can see where I am screwing up. Thanks :) AgeCalc.zip
Recommended Posts
This topic is 6943 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