Time difference question

Hello,

I am making a travel questionnaire as part of a project. It contains asking departure time and arrival time for trips. I need an “acknowledge” question underneath to prompt warning if duration of the trip is greater than 2 hours. For this, difference between aforementioned times can be calculated to work out duration and linked with acknowledge question.
Here is the link to the form,“https://kf.kobotoolbox.org/#/forms/aDpd6EkTv7bJkoaHMTNpv2

The form is currently existing at 12 hour format(AM/PM). I copied theses times on a new row in XLS and converted into 24 hour format. But either way calculation is not functioning.

Any assistance in this regard is highly appreciated. Thanks.

Welcome @transportengineer,
Maybe the search function of this forum can help you
https://community.kobotoolbox.org/search?context=topic&context_id=22948&q=time%20difference&skip_context=true

2 Likes

@transportengineer, maybe you could do it as outlined in the image shared below:

In the survey tab of your xlsform:

Data entry screen as seen in Enekto: error message missing

Data entry screen as seen in Enekto: error message seen

Reference xlsform:

Time Difference.xls (32.5 KB)

1 Like

Its working! Many thanks @Kal_Lam .

1 Like