Dataview Won't Query Tasks Correctly When "due" is a link [[YYYY-MM-DD]]

What I’m trying to do

I’m using the natural language dates, tasks, and dataview plugins. I have natural language dates set to insert dates as links. When I create a task, I use the Tasks plugin’s auto suggest menu to select the “due” icon :date:. I then type “@” to initiate the natural language selector, pick a date and hit enter. That date becomes a link such that my task looks like
- [ ] task info 📅 [[2023-08-08]]

I want a dataview query that simply returns not done tasks due today, but I can’t seem to query against a due date that is also a link.

Things I have tried

If I simply turn off the Natural Language Dates setting that inserts as links, then the problem is solved.

Without NLD insert as link:
this works (from within my daily note):

TASK
WHERE due = date(this.file.link)

this works:

TASK
WHERE due = date(this.file.name)

this works:

TASK
WHERE due = date("2023-08-08")

But as soon as I make my task’s due date a link, dataview says “No results to show for task query.”

Any help would be appreciated!

1 Like

Does this help?

The query below works in local tests:

  1. The daily note’s file name is a date
  2. The syntax for the task is as written below
  3. And the query below that
***
- [ ] This task should appear in the query below [🗓:: [[2023-08-09]]]

> [!attention]+ today
> ```dataview
> TASK
> FROM "" 
> WHERE date(🗓) = date(today)
> ```

***

Interestingly, pasting that exactly into my vault yields this:

Dataview can be slow to reload. Nothing even after a few seconds?

I have tried the code in three separate vaults and it works everywhere.

Hope someone else can help.

And did you test this in a file where the name matches the meta and query? File name needs to match: 2023-08-09

dataview lag

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