The Date duration field can be used to calculate the difference between two Date fields in a table. To set up the calculation, two fields are selected as the From date and To date in the advanced properties. The field will select the From date in the current table row and calculate the number of days, months or years until the To date in the following table row. The two dates can refer to the same field, as shown in the image below. Date duration calculations can be used in event, profile and database forms. They are not yet supported in the Smartabase Athlete or Kiosk applications.
The example above shows a vaccination form for practitioners to record a patients' vaccination history. Each vaccination is listed in a separate row in a table. Practitioners select a vaccine and note the treatment date using a Date field. A Date duration calculation in the table named Months between treatments records the number of months between each vaccination. This provides practitioners with a way to forecast ongoing vaccinations for the patient. To set up the Date duration field, both the From date and To date have been set as the Treatment date field. The calculation returns the difference between these dates in months.
The example above shows that a patient received the Dukoral vaccine on 1/7/2015 and then received the Influenza vaccine on the 13/07/2017. The Months between treatments calculation shows that there were 24 months between the first vaccine (Dukoral) and the second vaccine (Influenza).