I have this table in SQLite on Android device:
CREATE TABLE IF NOT EXISTS MEN(_id INTEGER PRIMARY KEY AUTOINCREMENT,
Tdate date, Weight float, Total float, BMI float);
I insert data in this date format (31/05/2011 22:34)
String Tdate = android.text.format.DateFormat.format("dd/MM/yyyy k:mm", new java.util.Date());
SQL = "insert into MEN (Tdate,Weight,Total,BMI) values ('";
SQL += Tdate + "','" + ThisWeight + "','" + Total + "','" + BMI+ "')";
I run a query like this:
SELECT _id,Tdate,Weight,Total,BMI FROM MEN ORDER BY Tdate desc
But I see the data is not sorted:
31/05/2013 22:20
31/05/2013 19:06
29/04/2013 17:33
02/06/2013 19:25
02/06/2013 19:24