I am Facing a problem in a query.In which i retrive the data from database according to the date like if todays date is 17/09/2016 i want all the data which is saved on this date the problem is when i retrive its show me only one data and there are many data present in my database i cant get out from this problem. i know that it is a silly question but i am stuck in that from 2 to 3 days.
sqLiteDatabase.rawQuery("SELECT * from mytable where Date = (select max(Date) from mytable WHERE Date < DATE('now') );", null);
Cursor c = sqLiteDatabase.rawQuery("SELECT * from BluetoothDevice WHERE Date = date('now');", null);
while (c.moveToNext()) {
Date date = new Date();
date.setTime(Long.valueOf(c.getString(c.getColumnIndex("Date"))));
result.add(
new BluetoothDevice(
c.getString(c.getColumnIndex("Device")),
c.getString(c.getColumnIndex("Address")),
date
)
);
}
c.close();
return result;
}