You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
COUNT(DISTINCT CASE WHEN pce.enrollment_status = 'Enrolled' AND pce.enrolled_at IS NOT NULL AND (pce.enrollment_ended_at IS NULL OR pce.enrollment_ended_at > CURRENT_TIMESTAMP) THEN pce.id END) AS total_active_enrollments,
616
618
COUNT(DISTINCT CASE WHEN pc.status != 'Cancelled' THEN pc.id END) AS total_classes,
619
+
COUNT(DISTINCT CASE WHEN pc.status = 'Active' THEN pc.id END) AS total_active_classes,
617
620
COALESCE(SUM(CASE WHEN pc.status != 'Cancelled' THEN pc.capacity ELSE 0 END), 0) AS total_capacity
618
621
FROM programs p
619
622
JOIN facilities_programs fp ON fp.program_id = p.id
COUNT(DISTINCT CASE WHEN pce.enrollment_status = 'Enrolled' AND pce.enrolled_at IS NOT NULL AND (pce.enrollment_ended_at IS NULL OR pce.enrollment_ended_at > CURRENT_TIMESTAMP) THEN pce.id END) AS total_active_enrollments,
634
637
COUNT(DISTINCT CASE WHEN pc.status != 'Cancelled' THEN pc.id END) AS total_classes,
638
+
COUNT(DISTINCT CASE WHEN pc.status = 'Active' THEN pc.id END) AS total_active_classes,
635
639
COALESCE(SUM(CASE WHEN pc.status != 'Cancelled' THEN pc.capacity ELSE 0 END), 0) AS total_capacity
636
640
FROM programs p
637
641
LEFT JOIN facilities_programs fp ON fp.program_id = p.id
0 commit comments