What I’m trying to do
Hi everyone,
I am stuck on a weird issue with a dataview query that I’m hoping someone can help me with. I have read the documentation on how dataview is different from SQL but I still don’t understand what could be wrong here.
I have a Dataview query aimed at retrieving notes with a specific date across two different Notetypes (“Readwise” and “Literature”). The dates in those notes have different formats (which is a whole other issue =). Anyway, individually, the sub-queries work as expected and return a non-empty result, but when combined with the OR operator, the query returns empty results. This is unexpected to me at least.
Things I have tried
This is the combined query.
LIST title
WHERE (
(contains(Notetype, "Readwise") AND dateformat(date-created, "yyyy-MM-dd")="2024-04-22") OR
(contains(Notetype, "Literature") AND dateformat(date(replace(date-created, ",", "-"), "yyyy-M-d"), "yyyy-MM-dd")="2024-04-22")
)
I have tried various different ways of grouping the conditions, always with the same result, so I am assuming now that I am fundamentally misunderstanding something here?
- The query aims to find notes created on “2024-04-22” in either the “Readwise” or “Literature” Notetypes.
- Both individual sub-queries within the WHERE clause produce non-empty results.
- I’ve double-checked the data to ensure that notes with the specified date exist in both Notetypes.
Any insights or suggestions on how to troubleshoot this issue would be greatly appreciated.
thanks, pepepe