How to write an expression to calculate age in years and months and date in power builder

112 views Asked by At

How should I create an expression for converting edit mask date to users age in years months

like how to write the expression for computed field so that we select date on editmask and it will show age in years on computed field

1

There are 1 answers

0
RealHowTo On

Assuming that your editmask is called birthdate then this expression will compute the age at the current date.

IF((month(birthdate) > month(today()) OR (month(today()) = month(birthdate)) AND (day(today()) > day(birthdate)) ), year(today()) - year(birthdate) - 1, year(today()) - year(birthdate))