--- android/TrainInfoService/src/dk/thoerup/traininfoservice/SavedStatistics.java 2012/06/05 09:30:32 1811 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/SavedStatistics.java 2012/06/09 11:35:22 1812 @@ -72,6 +72,17 @@ ResultSet resAvg = stmt.executeQuery(sqlAvg); resAvg.next(); SavedStatBean avgBean = convertRow(resAvg); + + ////// + String sql30Avg = "SELECT count(*) AS count, round(avg(location+name+favorites),1) AS station, round(avg(location),1) as location, round(avg(name),1) as name, round(avg(favorites),1) as favorites, " + + "round(avg(departure),1) as departure, round(avg(depcache),1) as depcache, round(avg(deperror),1) as deperror, " + + "round(avg(timetable),1) as timetable, round(avg(timecache),1) as timecache, round(avg(timeerror),1) as timeerror " + + "FROM trainstatistics " + + "WHERE statisticsdate < now()::date AND statisticsdate >= (now()::date - interval '30 days')"; + + ResultSet res30Avg = stmt.executeQuery(sql30Avg); + res30Avg.next(); + SavedStatBean avg30Bean = convertRow(res30Avg); //////////////////////////////////////////////// @@ -95,6 +106,7 @@ request.setAttribute("avg", avgBean); + request.setAttribute("avg30", avg30Bean); request.setAttribute("stats", stats); request.setAttribute("top5", top5); request.getRequestDispatcher("/savedstatistics.jsp").forward(request, response);