android - Unable to get the proper result -


here function..

public cursor fetchallalarmgreaterbydate(long appdate, int apptime) {      return mdb.query(alarm_table, null, alarm_date + ">" + appdate             + " , " + alarm_time + ">" + apptime, null, null, null,             alarm_date + " asc" + " , " + alarm_time + " asc");  } 

i unable result in asc on both column alarm_date , alarm_time (it gives syntax error).

if use alarm_date + " asc" doesn't give error problem doesn't give result.

how make work properly?

try

public cursor fetchallalarmgreaterbydate(long appdate, int apptime) {return mdb.query(alarm_table, null, alarm_date + ">" + appdate  + " , " + alarm_time + ">" + apptime, null, null, null,             alarm_date + " asc" + " , " + alarm_time + " asc");  }  

just replace the"and" in query "," asc


Comments

Popular posts from this blog

mod rewrite - Doing external redirect. .htaccess NS flag not working. How to achieve similar results? -

mysql - How to insert just year and month into date field? -