sort date fields to obtain earliest date

Posted by manu on Stack Overflow See other posts from Stack Overflow or by manu
Published on 2011-01-03T11:21:20Z Indexed on 2011/01/03 11:54 UTC
Read the original article Hit count: 209

Filed under:
|

in my database , dates are stored in DD-mm-yyyy format , how can i sort this to obtain the earliest date ?

Cursor c = myDb.query(TABLE, new String[]{"dob"}, null, null, null, null, "dob");

I have selected it to order by dob field but its not ordered ... This is the output for the above query

01-03 17:14:51.595: VERBOSE/ORDER DOB(1431): 01-11-1977
01-03 17:14:51.595: VERBOSE/ORDER DOB(1431): 01-12-1988
01-03 17:14:51.614: VERBOSE/ORDER DOB(1431): 15-01-1977
01-03 17:14:51.656: VERBOSE/ORDER DOB(1431): 31-01-1988

© Stack Overflow or respective owner

Related posts about java

Related posts about android