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 cf5cce02ea99..98799653758c 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 @@ -543,7 +543,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 "