>How can I create an expression in expression builder to get a age of person based on their date of birth. For example:
>
>Dob Age
>10/25/44 53.4
>
>
>I tried the expression (date()-person.dob) but it gave me an error as Ambigious date/datetime contstant. Is it even possible to find number of years and months in expression
>
>
>Thanks
>Nick Patel
You can mess with this:
?dob({^1987/05/02})
PROCEDURE dob
LPARAMETERS tDOB
nYear = INT( ( DATE( ) - tDOB) / 365.25 )
nMonth = ( MOD( ( DATE( ) - tDOB), 365.25 ) ) / 30
cAge = ALLTRIM( STR( nYear ) ) + " years and " ;
+ ALLTRIM( STR( nMonth, 4 ,1 ) ) + " months"
RETURN cAge
Jim Philippi
quando omni flunkus moritati