lettings · v1 · Head of Lettings
221
homes at Mon 20:00
Homes with an empty spell open at now, not under renovation.
lettings · changed 2026-11-01: First version.
Tests
- count_between min 50.0 max 800.0
- unique on unit_id
SQL
SELECT v.unit_id, v.building_id, v.vacant_from, date_diff('day', v.vacant_from, {now}) AS days_vacant
FROM unit_vacancies v JOIN units u ON u.id = v.unit_id
WHERE v.vacant_from <= {now} AND (v.let_at IS NULL OR v.let_at > {now}) AND u.status <> 'renovation'
ORDER BY v.unit_id