Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch › Forums › Using Tap Forms 5 › Age calculation between and within forms
Tagged: Age calculations between forms
- This topic has 3 replies, 2 voices, and was last updated 6 years, 8 months ago by
Brendan.
-
AuthorPosts
-
March 18, 2019 at 8:00 PM #34053
SimonParticipantHi Bredan,
Firstly, I want to calculate the age a patient was when they had a scan. I manually enter in their DOB as a date, and the date-of-scan as a date. Both of these fields are in the same form. How do I make a new field which will automatically calculated the patients age in years as a new field ‘Age at scan”?
Secondly, I want to calculate a how old a patient was when they had a particular procedure. I have one primary form with patient name, DOB, ID number etc, and a secondary linked form for the procedure which has a procedure date. Each patient can have multiple procedures and thus procedure dates. For each procedure I’d like a field showing the patient’s age at that particular procedure, using the procedure date field, and their DOB from the primary form. Is there a way to do this??
Cheers,
SimonMarch 18, 2019 at 11:34 PM #34055
BrendanKeymasterHi Simon,
Add a Calculation field and use the formula:
YYMM(DOB; DateOfScan)That’ll display how many years and months there are between DOB and DateOfScan. Set the Result Type to Text for that one.
Or you can use:
YEARS(DOB; DateOfScan)That’ll return the number of years between the dates. It returns a Number.
For the second calculation, what type of Link to Form field do you use from the Patient form to the Procedure form? If it’s a One to Many, then you can add a Calculation field to your Procedure form and reference the DOB from the parent Patient form within the formula.
E.g.
YEARS(Patient::DOB; DateOfProcedure)When you double-click on parent field on the formula editor, Tap Forms will automatically put in the proper reference for you. If you end up getting something like COUNT::Patient::DOB then that means you don’t have a One to Many Link Type and that won’t work. And that’s because the Procedure record could have multiple parent Patient records.
Thanks!
Brendan
March 19, 2019 at 4:27 AM #34059
SimonParticipantThank you Brendan,
Both of your suggestions worked well!
Thank you :)
You have made an amazing App!March 19, 2019 at 2:02 PM #34063
BrendanKeymasterExcellent!
I’m glad that worked for you.
-
AuthorPosts
You must be logged in to reply to this topic.