Sorting so the date works in Dataviews

Using the code below, what I get is a list of notes, that sorts from newest to oldest date for February, but my march notes (newer, should be on the top) are at the bottom. What am I doing wrong here?

My code

TABLE WITHOUT ID link(file.link, " ") + "<strong>" + Title + "</strong><br>" + Summary + "<br>" + file.link AS Entries  
FROM "Captains Log/Daily Notes"  
SORT file.name desc    

What is the file.name format?

If YYYY MM DD, the sort order would be desc.

Angel

The File is named DD-MM-YYYY but in the YAML the date is set to YYYY-MM-DD because otherwise another table wouldn’t work.

But you’re sorting on the file.name, not the YAML. Can you sort on the YAML instead?

Angel

1 Like

Thank you, that works, I changed the last line of code to:

SORT default(date, "") desc  

And now it works, thank you very much

Good to hear.

Angel

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