From ecdf3f17cbcd27138c9290e0b5e631c0e09f1e1d Mon Sep 17 00:00:00 2001 From: Giuseppe Nespolino Date: Wed, 15 Jan 2025 17:21:33 +0100 Subject: [PATCH] fix: uses "year" column in rs_periodstructure instead of extracting the year from "startdate" [DHIS2-18738] (#19676) Signed-off-by: Giuseppe Nespolino --- .../hisp/dhis/analytics/table/JdbcAnalyticsTableManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManager.java b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManager.java index fb79db79140e..a981542d25cf 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManager.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManager.java @@ -542,7 +542,7 @@ private List getValueColumns() { */ private List getDataYears(AnalyticsTableUpdateParams params) { String sql = - "select distinct(extract(year from pe.startdate)) " + "select distinct(extract(year from pe.enddate)) " + "from datavalue dv " + "inner join period pe on dv.periodid=pe.periodid " + "where pe.startdate is not null "