Open deshario opened 7 years ago
Try with:
public static List<Records> getAllByYear(int year) {
Calendar cal = Calendar.getInstance();
cal.set(year, 0, 1, 0, 0, 0);
return new Select()
.from(Records.class)
.where("data_created >= ?", cal.getTimeInMillis())
.execute();
}
data_created in my table isn't timestamp format. This is a format of data_created : 2017-08-18 It seems to be not working. I need to use where clause strftime() by year or month or dayofmonth. Ex : select * from tablename where strftime('%Y-%m', data_created) = '2017-08' (select by month or year)
How to use strftime() in ActiveAndroid ! I'm gonna select records by specific dayofmonth or month or year ... but i have no idea that why where clause isn't working !