Calendar cal = Calendar.getInstance();
cal.setTime(lastDay);
// We recalculate the last day ...
db.sendDelete(args.getUser(),"goim_stats_game","day = ?",id);
db.sendDelete(args.getUser(),"goim_stats_presencestatus","day = ?",id);
db.sendDelete(args.getUser(),"goim_stats_day","id = ?",id);
// To recalculate the last day we also need to recalculate
// the day before so we get presences which started there and
// lasted until this day.
cal.add(Calendar.DAY_OF_MONTH,-1);
listOfPresenceLog = db.getListOfMaps("SELECT * FROM goim_presence_log WHERE jid = ? AND start > ? ORDER BY start",jid,cal.getTime());