Task Query for outstanding tasks in the past only (or how to use date queries)

Things I have tried

Hello!
I’ve searched for an answer in the forum and tried messing with my existing query but i’m going nowhere fast.
I’m not a coder so i apologise for the noobiness.

What I’m trying to do

I’ve installed dataview and am using it to get my old unfinished tasks and present them in a daily note under a section called ‘leftovers’. I want to present myself with tasks where the due date has passed.

I’m using this query which i got from the original youtube vid that sent me down this (wonderful) rabbit hole…

dv.taskList(dv.pages().file.tasks 
  .where(t => !t.completed)
  .where(t => t.text.includes("{{date:YYYY-MM-DD}}")))

This is fine if i dont fall behind or defer some tasks for a day or two or if i’m v organised with my due dates but i want a catch all for unfinished stuff in the past. If i remove the ‘date’ line then i get all the open tasks which dont have old due dates.

Any help appreciated.

Two starting questions:
1 - YouTube videos are more useful then actual plugin documentation?
2 - dvjs is a justified request or DQL is fine?

1.You know what it’s like…. You start watching one thing and then before you know it you’re installing plugins you have no right to use and it all seems so easy… but then the shu ha ri hits you and you realise you’re very shu and need help….

2.DQL is fine, i just want to see my old unfinished tasks :slight_smile:

Please leave here some examples of your tasks to see the format/syntax used to write the due date in each one.

  • [ ] Read Something and then add what you read in the daily journal note :date: 2022-09-14
  • [ ] One new phrase or word in [[German]] and put it there. :date: 2022-09-14
  • [ ] Learn a new Obsidian thing and put it in [[Play around with Obsidian]] :date: 2022-09-14

Thanks!

BTW, i really did spend quite some time in the manuals but realised i was a bit far out of my depth… I’m working on getting better!

So, you’re using the calendar emoji (as in Tasks plugin) instead of an inline field like my task [due:: 2022-09-12]. If the right emoji dataview recognize them as similar to due key.
I’m not sure about your goal, but start with this:

```dataview
TASK
WHERE !completed AND due
WHERE due <= date(today)
```
  • date(today) is a dynamic value, i.e., it changes everyday. if you want a fixed date use something like date(2022-09-01);
  • <= means «equal or less than» - if “equal” not relevant you can use only <

This is great!
Thank you very much.

I learned a few things here so thank you for that also.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.