Simple COQL datetime query not working

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.


  1. qryMap={"select_query":" select id from Deals where Modified_Time>Created_Time"}

  2. res= invokeurl
  3. [
  4. url :coqlEndpoint
  5. type :POST
  6. parameters:qryMap.toString()
  7. connection:"the connection"
  8. ];
This is what gets returned.
  1. {"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?





                            Zoho Desk Resources

                            • Desk Community Learning Series


                            • Digest


                            • Functions


                            • Meetups


                            • Kbase


                            • Resources


                            • Glossary


                            • Desk Marketplace


                            • MVP Corner


                            • Word of the Day



                                Zoho Marketing Automation


                                        Manage your brands on social media



                                                Zoho TeamInbox Resources

                                                  Zoho DataPrep Resources



                                                    Zoho CRM Plus Resources

                                                      Zoho Books Resources


                                                        Zoho Subscriptions Resources

                                                          Zoho Projects Resources


                                                            Zoho Sprints Resources


                                                              Qntrl Resources


                                                                Zoho Creator Resources


                                                                  Zoho WorkDrive Resources



                                                                    Zoho Campaigns Resources

                                                                      Zoho CRM Resources

                                                                      • CRM Community Learning Series

                                                                        CRM Community Learning Series


                                                                      • Tips

                                                                        Tips

                                                                      • Functions

                                                                        Functions

                                                                      • Meetups

                                                                        Meetups

                                                                      • Kbase

                                                                        Kbase

                                                                      • Resources

                                                                        Resources

                                                                      • Digest

                                                                        Digest

                                                                      • CRM Marketplace

                                                                        CRM Marketplace

                                                                      • MVP Corner

                                                                        MVP Corner

                                                                      





                                                                      




                                                                          Design. Discuss. Deliver.

                                                                          Create visually engaging stories with Zoho Show.

                                                                          Get Started Now