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 "