Querying Date Range from YAML Field - Dataview

Hi.
About your problem, you have many issues with your frontmatter fields. All invalid values…
I don’t know where to start…

  1. Why you use square brackets - [ ... ] - in your fields?
    You can use square brackets to multiple values - a list -, but for single values that isn’t necessary and complicates your dataview queries - because you can’t query a single value but an array/list (for example, you never can’t use WHERE Deal_Name = "xxxxxxxxx" but need to use always WHERE contains(Deal_Name, "xxxxxxxxx").
---
Deal_ID: 0000000000
Deal_Name: xxxxxxxxx
Company_Name: xxxxx
Next_Action: 3/25/22 - Working on it
Deal_Stage: xxxxxxxxxx
Close_Date: 2022-04-30T12:28
Deal_owner: wbaker
Amount: 999999.0
Field_A: ["value 1", "value 2", "value 3"]
Field_B:
  - value B1
  - value B2
  - value B3
---
  1. For multiples values (a list) use one of the options above in Field_A and Field_B

  2. You need to use straight quotes ("), not curly quotes ().

  3. In frontmatter, quotes are used for strings, links… For numbers and dates/time you don’t need to use quotes.

  4. Formats defined in dataview settings are formats for the output (how you “view” a date in your query results), not the format how you need to write your data. For dates you need to use the format YYYY-MM-DD (e.g 2022-04-07); for timestamp you need to use the format YYYY-MM-DDTHH:mm (e.g 2022-04-07T19:23)
    Data Annotation - Dataview

For now clarify the right way and the right syntax to write your data… and then we can talk about the dataview query.

2 Likes