Dataview tasks, started sorted wrong?

Hi I have a problem. I have this dataview:

TASK
FROM ""
WHERE (due < date(today) OR start < date(today)) 
AND !completed 
AND status != "?" 
AND status != "-" 
AND status != "A" 
AND status != "!" 
AND (due OR start)


FLATTEN choice(contains(text, "🔺"), 1, choice(contains(text, "⏫"), 2, choice(contains(text, "🔼"), 3, choice(contains(text, "🔽"), 5, choice(contains(text, "⏬️"), 6, 4))))) as priority 
SORT priority SORT due ASC, start ASC

And certain tasks that look like:

  • example :airplane_departure: 2025-07-03 :upwards_button:

are still shown, even though they start in the FUTURE. What is wrong with my query?

Thank you in advance! Best smrtzo

Moved to Help

Dataview and/or Tasks are community plugins.

Update to this:

AND ((due AND due <= date(today)) OR (start AND start <= date(today)))

This prevents null dates from slipping through and ensures the task actually has a due or start field before comparing.