TQL covering the last 24 hours

I would like to have a relative time constraint that will cover the last 24 hours from the time ran.

Of course I can do this, and it works, but is there an easier way?

s.beginTime == in {“now-0h/h”, “now-1h/h”, “now-2h/h”, “now-3h/h”, “now-04h/h”, “now-5h/h”, “now-6h/h”, “now-7h/h”, “now-8h/h”, “now-9h/h”, “now-10h/h”, “now-11h/h”, “now-12h/h”, “now-13h/h”, “now-14h/h”, “now-15h/h”, “now-16h/h”, “now-17h/h”, “now-18h/h”, “now-19h/h”, “now-20h/h”, “now-21h/h”, “now-22h/h”, “now-23h/h”, “now-24h/h”}

An absolute query would do the same, of course, but always has to be adjusted, which is a nuisance:

s.beginTime == in {“2022-07-28T10:00”…“2022-07-29T10:00”}

If anyone has ideas for this, would be great to hear them.

Hi Fred,

Lovely seeing you here as always. The query you posted does not look optimal indeed, I believe this query could help you out:

la s.id, s.beginTime : s.beginTime >= “now-24h/h”

The difference here is in the constraint where we initially restrict the s.beginTime to be earlier 24 hours old.

Please let me know how it goes,

1 Like

Thanks for sharing this insight. Apologies for the late reply, as I was on vacation the last three weeks. I will try this out.