How to tell the difference between two dates and display the Year, Month and Day?

Bonjour j’ai un souci. j’aimerai faire connaitre la différence entre deux date et avoir le resultat en jour mois et année et je n’y arrive pas. J’ai une convention signe le 22 juin 2021 valabe pour trois ans. A la date du 22 juin 2023, j’aimerai savoir cimbien de temps en jour, mois et il reste avec kobo

@Originaal, you should be able to do it as outlined in the image shared below:

In the survey tab of your XLSForm:

Data entry screen as seen in Enketo:

Reference XLSForm:

Calculate Date (Year, Month, Day).xlsx (9.8 KB)

merci bien pour la solution

1 Like

Is there a calculation for weeks between dates?
Secondly,
These formulae:
abs(int(format-date(${DOI}, ‘%d’) - format-date(${DOB}, ‘%d’)))
abs(int(format-date(${DOI}, ‘%m’) - format-date(${DOB}, ‘%m’)))
abs(int(format-date(${DOI}, ‘%Y’) - format-date(${DOB}, ‘%Y’)))
if used in the “Calculate” question type are giving wrong answers. am only using date and day. As long as i input a date beyond this month even if i input 31st October 2023 and 11th November 2023 it gives me 1 months and several days. What should i do?