mercredi 12 août 2015

How to do date conditions for sugar ORM queries

Been stuck trying to make this work for a while: I am using sugar ORM for sqlite in my android app and I am trying to write a query with a condition on a date field. The where clause format for sqlite dates does not seem to be working.

eg:

MySugarRecordClass.find(MySugarRecordClass.class, "some_date_field>?", "2015-01-01")

or

MySugarRecordClass.find(MySugarRecordClass.class, "date(some_date_field)>date(?)", "2015-01-01")

I have tried using several date formats but I still can't get it.

Aucun commentaire:

Enregistrer un commentaire