How can I calculate age at the time of an event in years?
I have the fields for Date of even and date of birth (DOB). I would like to calculate the age using these and display it in years. When i use the formula Date-DOB then the time elapsed displays in days. I have tried to divide by 365 and it will display as the age by followed by days, minutes and seconds.
Can anyone help me with this?
4 replies
-
You can calculate the age with the following formula:
---
age(DOB)
---
regards
Leo
-
Or - if you have 2 date fields (Date and DOB):
–––
year('Date') - year('DOB') - if month('Date') < month('DOB') then
1
else
if month('Date') = month('DOB') and day('Date') < day('DOB') then
1
else
0
end
end + " year(s)"
––– -
I find by doing that you get the age in years, but no decimal places
-
I had the same problem and this is how I solved it:
field called OR Date = this was a date field for when patient had surgery (the event)
field called DOB = this was a date field for their date of birth
let elapsed := today() - 'OR Date';
age(DOB + elapsed)
Content aside
- 2 yrs agoLast active
- 4Replies
- 2846Views
-
1
Following