calculate age

hi all,

i have two fields birth date and current date(systemdateget())…

i need to calculate the age of a particular person…based on those two fields provided.

what would be the logic for this requirement…

Ur replies would be very much thankful…


static void Job9(Args _args)
date1980 date1 = mkdate(01,01,1990);
real calcdate;

calcdate = (systemdateget() - date1)/365;
info(strfmt(‘Age in years: %1’, num2str(calcdate,2,0,0,0)));

this might help you…


We can use yearDIff(Date 2, date 1);

But its return only the Integer value; ie 25;

For age we no need fraction value ( If u want faction too start use above chaitanya’s code)

I hope its help u to solve ur pblm

for more clarity on age …to be displayed in decimal values…we can use

“num2str function”