Dataview: Difference between dates, BUT if 0 should output "0 days" and not just leave blank

Continuing the discussion from How to Calculate Duration between Dates in Dataview:

This works great, but if the result is 0 I get a blank. I’m not using this for ages but for the length of time it takes to read a book, so sometimes I have a difference of 0, but I’d like it to say that instead of just leaving a blank.

I’ve tried choice((DateFinished = DateStarted), "0 days", DateFinished ) - DateStarted as Diff but that just entirely excludes those books of 0 days, likely because it can’t subtract a string from a value.

Any ideas?

1 Like