hello guys for the last three days I have been working on a simple query , but it is just not working , I'm trying to prevent register departure without having registered arrival , here is the code in my DB helper,not sure what is wrong with that query!!
public Boolean HasShowedUpToday(int check_id)
{
Boolean attend;
SQLiteDatabase db=this.getWritableDatabase();
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault());
time=Calendar.getInstance().getTime();
String dateoftoday= dateFormat.format(time);
Cursor c = db.rawQuery("SELECT * FROM attendance where user_id = '"+check_id+"' and arrival_time ='"+dateoftoday+"' and departure_time ='';", null);
if (c.moveToFirst())
{
attend=true;
}
else
{
attend=false;
}
return attend;
}