How to retrieve data based on date query?

I have a datetime type column in db called leavingDate, and I’m trying to fetch data based on a condition:
“leavingDate>=’”+minDate+"’ AND leavingDate<=’"+maxDate+" ’ ";
now minDate and maxDate are in UTC format. and I have an object in the db that has a leavingDate that matches this condition(when the Dates in UTC checkbox is checked), but it’s not being fetched.

minDate and maxDate should be local? or UTC>? or epoch?..

Hi @adel_kasno !

Unfortunately formatted literals are not supported. You should provide your datetime value as timestamp in millis for whereClause.

Regards, Andriy