Query beetwen two dates

Certified Senior Developer

Hi,
I kindly ask you for an opinion on a problem that I have been dragging along for some time.
I have a query in which I need to extract data between two dates: startDate and endDate.
The data on the db and CDT are in date and time format.
The range extremes are entered from the user interface in Date format, the same are the query rule inputs.

a!queryFilter(
   field: "timestamp",
   operator: "between",
   value: {
       todatetime(ri!startDate),todatetime(ri!endDate)
   }
),

But when I do, for example, todatetime (12/21/2020), I get 12/21/2020 1:00 AM GMT + 01: 00 (in my local time zone).

So I can't actually take dates from the beginning of startDate=00:00 AM to the end of endDate= 11:59 PM.

I am trying this solution:

a!queryFilter(
    field: "timestamp",
    operator: "between",
    value: {
      todatetime(concat(tostring(ri!startDate), " 00:00 AM")),
      todatetime(concat(tostring(ri!endDate), " 11:59 PM"))
    }
), 

It's that right? Are there any other solutions?

Regards, and thank you very much

  Discussion posts and replies are publicly visible