Common Logic and Calculations
To learn more about calculations in CommCare, check out the CommCare Calculations Course! This course will guide you through a series of tutorials, exercises, and examples, to prepare you to build calculations in CommCare
Welcome to Common Logic and Calculations! This page contains descriptions of advanced techniques and examples for you to use when building CommCare Forms.
How do we check if the LMP date is 3 months less than the current date?
I have created a Date Field to accept the LMP date. How do we check if the LMP date is 3 months less than the current date?
Then, I create a label and under logic, in the "Display Condition," I enter the following code: int((today() - (/data/imp + 90)) div 30.4) to determine the number of months from the user-entered LMP date. Is it correct?