question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug report — Sorting dates by descending shows null values first (0.5.2 beta)

See original GitHub issue

What happened?

Dataview 0.5.2 seems to have introduced an issue when sorting dates in descending order, e.g. sort date desc when the query contains null values.

Previously (0.4.2+) when sorting by descending date, the most recent dates would appear at the top of the list. Null values would appear at the bottom.

In 0.5.2 null values appear at the top, then followed by the most recent to oldest.

DQL

No response

JS

No response

Dataview Version

0.5.2

Obsidian Version

0.14.14

OS

MacOS

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
AB1908commented, Jul 10, 2022

No. Can still get around it by using default() and/or some custom function for sorting.

1reaction
blacksmithgucommented, Jun 4, 2022

I swapped the order that null appears in sorts (from nulls FIRST to nulls LAST by default); I’m not sure why I did that. Let me check the git history.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ORDER BY DATE showing NULLS first then most recent dates
I would like my results ordered by a date field and display all records with NULL dates first and then the most recent...
Read more >
sort date field descending with null listed first - MSDN - Microsoft
They want to be able to sort descending on the "to" field so that they see the most recent listed first. The problem...
Read more >
How ORDER BY and NULL Work Together in SQL
You'll see the NULLs first when a column is sorted in ascending order and last when the column is sorted in descending order....
Read more >
af:table clicking on a Column to Sort Descending shows Null ...
in the base view object class. By default, this method returns null because the sorting is done in the database through a SQL...
Read more >
DescTools.pdf
Easy format for numbers and dates. Desc. Produce a rich description of an object. Abstract. Display compact overview of the structure of a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found