I find some data with a date reference i would like to delete at the Interviewer level tablet after updating their program, in this way i wrote this function but it seems it not deleting cases created on or before 26th June 2020. The intend again is to delete cases created on or a particular date on Interviewers Tablet.
The loop and delete calls seem okay. I would be worried about how you're using the date of interview though. It's generally best to use dates in the format YYYYMMDD if you want to do comparisons. Your code, for example, would not delete a case from 27 May because 27052020 is not <= 26062020.
You will likely want to convert your DDMMYYYY date into a format where you can do the comparison. Something like this: