@rigmarole the tasks include any traditionally formatted task items and I use of the obsidian-tasks plugin. Each task is followed by any combination of dates, at least one of which qualifies as “happens” (the earliest of start date, scheduled date, and due date).
- [ ] task A ⏳ 2024-10-25
- [-] task B ⏬ ⏳ 2024-10-25 ❌ 2024-10-22
- [x] task C 🛫 2024-10-22 ✅ 2024-10-21
You can’t mix syntax from tasks and dataview and expect it to work. It seems like you’ve the first part with syntax from the tasks plugin (and your code block also indicates this), and then you try to use group by and flatten as if it was an dataview query. (And your example is from the Dataview documentation)
You need to decide which plugin to use for this query, and read the corresponding documentation.