Weird YAML Date Field Retrieval

Setup

  • The YAML for all of my notes look like this
aliases: [ ]
cssclass:
publish: false
permalink: 
banner:
create_date: 14-Apr-2023
description: 
note:
	type: admin_doc
  • There are other note.type like research_doc, learning_doc, journal etc

  • Dataview Settings for Date Format

Problem
Trying to run a few very simple queries.

  • First one:
LIST
WHERE note.type = admin_doc

→ Dataview outputs all my notes, regardless of the note.type

  • 2nd one:
LIST
WHERE create_date = "15-May-2023"

→ Dataview again outputs all my notes, ignoring the WHERE clause

Tried querying with tags and it looks fine. Anyone with any idea?

Don’t know if this is down to the forum or not, but your YAML didn’t validate when copied and pasted (the type was tabbed not spaced).

The following worked for me:

---
aliases: [ ]
cssclass:
publish: false
permalink: 
banner:
create_date: 14-Apr-2023
description: 
note:
  type: admin_doc
---

## note type
```dataview
LIST
WHERE note.type = "admin_doc"
```

## create date
```dataview
LIST
WHERE create_date = "14-Apr-2023"
```


And FWIW, Dataview works with dates in ISO8601 format:

https://blacksmithgu.github.io/obsidian-dataview/annotation/types-of-metadata/#date

@anon63144152 thank you very much for the tip. Indeed there is something wrong with copy and pasting. Following your advice, I did 2 things:

  1. when copying and pasting markdown, always ‘Paste as plain text’
  2. space instead of tab when creating hierarchical YAML properties

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