From 799132025689601006273cb8445678733896cf61 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Wed, 11 Sep 2024 19:49:17 -0700 Subject: [PATCH] Fix SQL queries on demographics page --- pkg/models/demographic/queries.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/models/demographic/queries.go b/pkg/models/demographic/queries.go index df0a52d..8767417 100644 --- a/pkg/models/demographic/queries.go +++ b/pkg/models/demographic/queries.go @@ -123,6 +123,8 @@ func PeopleStatistics() People { COUNT(*) AS user_count FROM users + WHERE users.status = 'active' + AND users.certified IS TRUE GROUP BY CASE WHEN DATE_PART('year', AGE(birthdate)) BETWEEN 0 AND 25 THEN '18-25'