Calculate Age (Current date - Birth Date = Age Years)

Calculate Age (Current date - Birth Date = Age Years)

  

Hello,

Is there any quick reference for calculating Age using a Birth Date and Current Date?  Both Date data type.

is it like this:  DiffDays(CurrDate(),BirtDate()) / 365

Appreciate any assistance.

Bye.



Hi Larry,

You can create your own server action and reuse it whenever you need it. 

Also if you set function to Yes (since it will have one input and one output parameter), you can use it inside an expression




If( Month(BirthDate)<Month(CurrDate()), 
    Year(CurrDate())-Year(BirthDate) - 1, 
        If( Month(BirthDate)=Month(CurrDate()) and Day(CurrDate())<Day(BirthDate),
            Year(CurrDate())-Year(BirthDate) - 1, 
                Year(CurrDate())-Year(BirthDate)))


Cheers



Thank you Andre - I will do that.