Topic: Calculated field

Hello,

I am looking for a formula for a calculated field that determines the age of a person from the difference between the date of birth and the current date. I tried a solution from Derek but his solution does not work with Mysql. Can someone help me?

Re: Calculated field

k.krause wrote:

Hello,

I am looking for a formula for a calculated field that determines the age of a person from the difference between the date of birth and the current date. I tried a solution from Derek but his solution does not work with Mysql. Can someone help me?

Try this one

TIMESTAMPDIFF(YEAR, date_of_birth, CURDATE())
brian

3 (edited by k.krause 2021-12-13 11:52:50)

Re: Calculated field

Hi Brian, thanks for your quick answer. It works perfect.

I have another question. Can I extend the outcome of the calculation field, e.g. 45, with the text “ Year”

I tried to extend your solution with “+ ‘Year’, but it does not work.

So you have any suggestion?

4 (edited by sparrow 2021-12-13 14:08:17)

Re: Calculated field

if you use MYSQL query:

CONCAT(TIMESTAMPDIFF(YEAR, date_of_birth, CURDATE())," Year")

Re: Calculated field

Thanks Sparrow for your answer. It works perfect