jeudi 3 juillet 2014

How can i get max data and minimum data from sqlite database in andorid?


Vote count:

-1




In my project i stored the dates in the dateadded filed like below.



01-07-14 12:00
02-07-14 12:00
25-06-14 13.00


When i fire query for minimum date:



Select dateadded from dgadata order by dateadded asc limit 1


That is return 01-07-14 12:00 and even if i write Select min(dateadded) from dgadata the output is same. But here the minimum date is 26-06-14 13.00


And in the max date i write like



Select dateadded from dgadata order by dateadded desc limit 1


Here the result is 25-06-14 13.00 but here the max date is 02-07-14 12:00


I think my query is fine i don't know why i am getting wrong result. Please help me.


Thanks


Shankar



asked 45 secs ago






Aucun commentaire:

Enregistrer un commentaire