public DataPoint[] GeraGraficoEstudoMes(String Situacao, String idTema){
int i=0;
String wSql = " SELECT strftime(''%d'',data) AS DIA, Count(1) AS TOTAL_ACERTO FROM CRTGRAFICOESTUDO " +
" WHERE ACERTOU='" + Situacao + "'" +
" AND strftime(''%Y'',data)=strftime(''%Y'',''now'') " +
" AND strftime(''%m'',data)=strftime(''%m'',''now'') ";
if (!idTema.isEmpty()) {
wSql = wSql + " AND TAB_TEMA_ID=" + idTema;
}
wSql = wSql + " GROUP BY strftime(''%d'',data) ";
wSql = wSql + " ORDER BY strftime(''%d'',data) ";
openDataBase();
Cursor cs = mSQSqLiteDatabase.rawQuery(wSql, null);
DataPoint[] points = new DataPoint[cs.getCount()];
if (cs.getCount() > 0) {
if (cs.moveToFirst()) {
while (!cs.isAfterLast()) {
points[i] = new DataPoint(cs.getInt(0), cs.getInt(1));
cs.moveToNext();
}
}
}
cs.close();
closeDataBase();
return points;
}
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE