January 23, 200620 yr 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)) )
January 23, 200620 yr What do you want the results to look like. 50 49 years, 11 months, 17 days, 49 years Or something else. Lee
January 23, 200620 yr 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, 200620 yr by Guest test
January 23, 200620 yr Author 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 ?
January 23, 200620 yr The calculation contains is text, so change it from the default of Number to Text. Lee
January 23, 200620 yr Author 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
Create an account or sign in to comment