How to Calculate Duration between Dates in Dataview

Angel’s answer will work using just dataview, if you don’t want to go down the Javascript path.

One thing to note however, if the person does not have a recorded date of death, then that person will not be listed in the table. Not knowing how all the files are set up, this might not be a problem. If there are people who are still living, you could calculate the age with something similar to the following in your dataview query:

choice(!Death, date(today), Death) - Birth as Age

This says if there is no value for Death replace it with the current date.

Screenshot of original post, and the updated view taking living persons into account:

8 Likes