If you’re using date(today) it’s always going to be looking at today, so you should theoretically have no files that were created 30 days from now since that date hasn’t happened yet. So are you actually replacing date(today) with a specific date and you want to look 30 days from that static date or am I missing something obvious?
I use this query to look at a rolling 30 days in the past:
TASK
WHERE status = "w"
WHERE file.day > date(now) - dur(30 days)
SORT cdate ASC
TABLE
FROM "" AND #
WHERE date >= date(now) AND date <= date(now)+dur(30 d)
Durations
For anyone else looking into this you can look up the “Durations” (Lengths of time Dataview can use to calculate dates from date now) in the below doc. Then plug it into this snippet
Most of my dataview queries are generated in fixed way through Calendar plugin with set dates.
Useful for fixed notes
This above solution is useful if you have a static page such as “Up Coming Events” which will update to show important stuff coming up based on when your looking at the note, not when it was created.
You’re welcome.
Mind that with your files already being named by date you could even clean up and get rid of the fdate property at all by using the following.
WHERE date(file.name) >= date(now) AND date(file.name) <= date(now)+dur(30 d)
In fact dataview plugin already has built-in functionality which would only require a bit mathematical effort on resolving the quarter task. Week of year, e.g. should be easily accessed by following:
Given that either the file name contains an ISO date, or a field like date: YYYY-MM-DD then it’s accessible in Dataview through file.day. And if you want extra dates in other fields I always use that format, as it displays according to locale rules (or date formatting if I want something special), and it allows for extraction of the different parts thorough stuff like fdate.year or similar.
In short, given the ISO date format of YYYY-MM-DD you are very free to do a lot of stuff without to much hassle.