jeudi 25 juin 2015

Sort Date column which is in MM/dd/yyyy format in sqlite

I want to get the max date first but the following querry doenot return the correct data

Cursor mCursor = db.rawQuery("select * from "
                + ESERVICE_TICKET_SYNC_TABLE + " where " + ESERVICE_SEND_STATUS
                + " = ? AND " + ESERVICE_USER_ID + " = ? order by date("
                + ESERVICE_CREATION_DATE + ") DESC ", new String[] {
                send_status, user_id });

I had stored the ESERVICE_CREATION_DATE in the format mm/dd/yyyy which is a text. Thanks in Advance.

Aucun commentaire:

Enregistrer un commentaire