Simple COQL datetime query not working
I am trying to do a simple COQL query where I am comparing 2 datetime fields in a module and I keep getting the following error. Why does ZOHO make working with dates so difficult? I even tried running the following query against two datetime fields that are build into each module by ZOHO themselves and it still does not work.
- qryMap={"select_query":" select id from Deals where Modified_Time>Created_Time"}
- res= invokeurl
- [
- url :coqlEndpoint
- type :POST
- parameters:qryMap.toString()
- connection:"the connection"
- ];
This is what gets returned.
- {"code":"INVALID_QUERY","details":{"expected_data_type":"datetime","column_name":"Modified_Time"},"message":"value given seems to be invalid for the column","status":"error"}
If you replace the date with plain TEXT for example '2021-09-16T10:10:00+02:00' then it all works fine.
Any ideas?