Jun 13, 2016 07:03 AM
DATETIME_DIFF([date1], [date2], ‘units’)
I saw this formula but how do I modify it to include my fields and a result in years for the units?
Jun 13, 2016 07:56 AM
Here’s my age formula: DATETIME_DIFF(TODAY(), Birthday, ‘years’)
I have a field named “Birthday” in my table that contains the birthdate.
Jun 14, 2016 01:05 PM
I use Tim’s method, understanding you get an “ERROR” if the birthday field is not filled in.
Feb 21, 2017 11:24 AM
What do I do If I need my output to be years and months?
Feb 21, 2017 01:40 PM
To get the age of a person in months:
DATETIME_DIFF(TODAY(), Birthday, 'months')
-> 346
Modifying the above to always give you the remainder when dividing by years, using MOD:
MOD(DATETIME_DIFF(TODAY(), Birthday, 'months'), 12)
-> 10
Finally, concatenating that with the age in years and adding units:
DATETIME_DIFF(TODAY(), Birthday, 'years') & ' years, ' & MOD(DATETIME_DIFF(TODAY(), Birthday, 'months'), 12) & ' months'
-> 28 years, 10 months
Jan 07, 2018 03:49 PM
For the formula to work for me, I needed to make: , Birthday, => ,{Birthday},
Thanks for the help.
Jan 11, 2018 09:58 AM
Trying to use your DATETIME_DIFF(TODAY(), Birthday, ‘years’)
Still getting that error!! Please help!
Jan 11, 2018 09:59 AM
Please send me the entire code formula! Thanks.
Jan 11, 2018 06:59 PM
DATETIME_DIFF(TODAY(), {Birthday}, ‘years’)
And {Birthday} is a field in my table, of course.
Hope that works for you.
Jan 11, 2018 08:04 PM
Still giving the formula error!