Error re date format, although corrected after upload from csv

Hi

I give it up: I have tried so many variations, but all date-related functions used with my date fields pulled from a csv file create an error message when trying to deploy the form.

When pulling that date field from csv, it has the format dd/mm/yyyy. Therefore, I have used a simple concatenate formula to change it into what I understand is the correct format to allow calculations with dates:
concat(substr(${imported_date},6,10),’-’,substr(${imported_date},3,5),’-’,substr(${imported_date},0,2)).

I create a note type filed to show the result and it looks like the date, I want to compare it with (entered at the beginning of the form):
raw: ${imported_date}, reformatted: ${imported_date_reformatted}, date: ${date}

Result:

The error message has a VERY STRANGE part:
type mismatch \nThe value \“ties-il-fa\” can’t be converted to a date.

How does 2024-04-01 become ties-il-fa?

Complete message:
Unexpected KoBoCAT error 400: b’{“detail”:“ODK Validate Errors:\n>> Something broke the parser. See above for a hint.\nError evaluating field ‘test7b’ (${basics}[1]/test7b[1]): The problem was located in Calculate expression for ${test7b}\nXPath evaluation: type mismatch \nThe value \“ties-il-fa\” can’t be converted to a date.\nCaused by: org.javarosa.xpath.XPathTypeMismatchException: The problem was located in Calculate expression for ${test7b}\nXPath evaluation: type mismatch \nThe value \“ties-il-fa\” can’t be converted to a date.\n\t… 10 more\n\nThe following files failed validation:\n${tmp4a48nsrj}\n\nResult: Invalid”}’

Anybody and idea???

@york_rff, maybe you could also share your XLSForm with the community.

…too complex. I would have to create an artificial short version and this would not have more than the described elements.

After having read some forum contributions (though re ODK: Validate reports bogus type mismatch error when checking XPath date arguments · Issue #405 · getodk/javarosa · GitHub) around a seemingly related bug and not understanding the suggested workaround, I have split the two dates (including the one pulled from a csv-file) in year, month and day and have created an awfully long if-formula to do the comparison with these six fields (actually it is many more because I compare a date against three dates…).