Is there a way to display files created and modified today?

I’ve been using ChatGPT to find various ways to display files created and modified today in my Daily Notes, but it’s not working correctly. Initially, I thought it would show only the files for that specific day, but it accumulates files from previous days. For example, if I created and modified a file on September 24th, it continues to display that file on September 26th even if I didn’t make any changes. Please help…

TABLE file.size as 크기, file.ctime as 생성시간, file.mtime as 수정시간
FROM "/"
sort file.ctime desc
Where date(2023-09-24) - file.ctime < dur(0 day)
Where date(2023-09-24) - file.mtime < dur(0 day)

Using it this way results in cumulative values

TABLE file.size as 크기, file.ctime as 생성시간, file.mtime as 수정시간
FROM "/"
WHERE date(file.ctime) = date(2023-09-24) AND date(file.mtime) = date(2023-09-24)

Even when used like this, it returns “No results” despite having results. There are no issues with the path or files at all.

Help me…:innocent::sob::sob::sob:

1 Like

I think this query should be close to what you’re looking for (if I didn’t misunderstand :innocent: )

```dataview
TABLE file.ctime AS "Created", file.mtime AS "Updated", file.size AS "Size" 
WHERE file.cday = date(today) OR file.mday = date(today)
```

The WHERE part looks for files where the creation date (cday) is equal to today (as a date) OR the modification date (mday) is equal to today (as a date).

And this seems to return a table displaying only the files which were either created or modified today :blush:

Now, as today changes everyday :sweat_smile:, if you use that query in each of your daily notes, the query will return the exact same results in any of the daily notes where you used it, regardless of the date/title of the daily note.

So, as I guess you want create some kind of “notes creation/modification logs” as in “what was created/modified on that day”, this would probably be more appropriate :blush: :

```dataview
TABLE file.ctime AS "Created", file.mtime AS "Updated", file.size AS "Size" 
WHERE file.cday = date(this.file.name) OR file.mday = date(this.file.name) 
```

The WHERE part of the query follows the same principle as previously but instead of comparing both the cday and mday to today , they’re both compared to the current daily note’s title (this.file.name).

In the 2023-09-25 daily note where I’ve tested the query, I got this result :

EDIT: Just in case I misunderstood :innocent: … and you actually want a table of all the notes created AND modified on the date corresponding to the daily note where you add the query, this should work:

```dataview
TABLE file.ctime AS "Created", file.mtime AS "Updated", file.size AS "Size" 
WHERE file.cday = date(this.file.name) AND file.mday = date(this.file.name) 
```

(The only difference is that I used AND instead of OR)

… which in the same daily note I previously used as a test (2023-09-25 ) now returns this:

I hope this helps a little :innocent:

4 Likes

You’re very welcome! I’m glad to hear that the solution worked well for you. If you ever have more questions or need assistance in the future, feel free to reach out. Have a great day!

1 Like

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