Another newbie question! What am I missing to make this show results only from the past 7 days instead of everything, which is what it does now
TABLE WITHOUT ID
file.link as Date,
choice(IF_hrs > 18, "✅", "❌") as IF,
choice(pushups > 1, "✅", "❌") as pushups,
reading as Reading
FROM "Daily Notes"
WHERE file.link > (date(now) - dur(7 days))
SORT file.day DESC
I can’t answer your question (sorry), but for next time I’d consider a more descriptive title. e.g. “Dataview - query last 7 days for X” (or similar).
More of a chance a Dataview wizard will click on the topic and have a look, imho.
A link is not a date, but you can use the filename to generate a date in some cases. What kind of filenames are you using?
If you’re really lucky you might use
date(file.name) > ...
If your file name contains a date, you can use
file.day to extract it. So you might try something like:
WHERE file.day > (date(now) - dur(7 days))
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.