I have a local database in android using sqlite , i used active android and my table pojo is like this:
@Column(index = true, unique = true , onUniqueConflict = Column.ConflictAction.REPLACE)
public long taskId;
@Column( index = true)
public String taskIdno;
@Column()
public String taskDescription;
@Column()
public String taskTypeId;
@Column()
public String customerName;
@Column()
public String customerContact;
@Column()
public String address;
@Column(index = true)
public int status;
@Column()
public Date startSchedule;
@Column()
public int first_visit;
@Column()
public String coordinates;
@Column()
public int radius;
@Column()
public long location_type_id;
@Column()
public long duration;
@Column()
public long taskType_id;
My problem is that my query for today doesnt work, Or there is something im missing here.
public static List<AATask> allTaskOrderedByDate(String asc_desc){
From from = new Select().from(AATask.class).where("strftime('%Y-%m-%d', startSchedule ) = strftime('%Y-%m-%d' , DATE('now'))").orderBy("startSchedule ".concat(asc_desc));
Log.w(TAG , from.toSql());
return from.execute();
}
startSchedule is converted to timeInMilliseconds(correct me if im wrong) default to active android Date object, How do I get today query?