Calculating age for a future date

Hi,I have used the formula below to calculate the age of a person and it works fine.

@If(@IsError(@Date(DOB));@Return(“0”);“”);

date1 := DOB;

date2 := @Today;

years := @Year(date2) - @Year(Date1);

monthDiff := @Month(date2) - @Month(date1);

adjust := @If(monthDiff < 0; -1; monthDiff = 0 & @Day(date2) < @Day(date1); -1; 0);

age := years + adjust; age

However I have now been asked to include a new field that automatically calculates how old someone would be on the 1st of June every year. However this is causing me problems as I can’t figure out how to do this in formula.

I would be very grateful if anyone could advise or guide me as to the best way to do it.

Many thanks

Charile

Subject: Calculating age for a future date

Put the date you are looking for into date2.

LN allows to subtract dates, e.g. date2 - date1. The result is the number of days between these two days. Then you can simply calculate this number of days as you want, e.g. divide by 7 to get the number of weeks, etc.

Subject: RE: Calculating age for a future date

Hi Thomas,many thanks or focusing my mind! Just to let you know that I’ve solved it.

Once again thanks

Charlie