How to automatically computed the age field once birthdate field is filled up?

Can somebody help me on How to automatically compute the age field once birthdate field is filled up? in Microsoft Dynamics NAV 2013.

Process:

when the vendor filled up the birthdate, then the age will be computed automatically.

Thanks in advance!!! :slight_smile:

AGE:=FORMAT(DATE2DMY(TODAY,3)-DATE2DMY(Birthdate,3));

Hi Sheila,

I have been using this function for years:

[CODE]FUNCTION CalcAge(BirthDate : Date) : Integer
// Returns number of years old - Takes leap years into account

IF BirthDate = 0D THEN
EXIT(0)
ELSE
EXIT(ROUND((TODAY - BirthDate)/365.2364,1,’<’)); [/CODE]

Thanks! I will try this.

I got it. thanks to your post. but I did this in message box only! how can I automatically computed it to the field? thanks in advance. :slight_smile:

you need to assign the values which have been calculated.

Like Age :=25