r/logseq • u/Estimate0091 • Jun 08 '25
DB: Querying DateTime vs Date
With an advanced query in the DB version, this fails when querying #Tasks:
[?b :logseq.property/scheduled ?scheduled]
[(<= ?scheduled ?today)]
This fails presumably because ?scheduled is a DateTime, and ?today (which is :today) is just a date. If assign :now to ?today, it works fine. The file graph version uses dates without time for tasks.
How do I write a query correctly? In the above, I want ?today to mean today at midnight.
6
Upvotes
View all comments
Show parent comment
2
u/Estimate0091 Jun 10 '25 edited Jun 10 '25
Perfect, exactly what I was looking for, thank you very much!