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

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -