I have a database which has a column of dates in milliseconds. I'm trying to perform a query which allows me to retrieve only the dates that开发者_如何学运维 are greater than the current system time and in ascending order.
This is what I have done, but it doesn't seem to work, help would be most appreciative.
    long lowestDate = 0;
    long currentTime = System.currentTimeMillis(); 
    String CT = Long.toString(currentTime);
    String[] args = {CT};
    mDb = mDbHelper.getReadableDatabase();
    String mySQL =   " select dt" 
                   + " from reminders"
                   + " where dt > " + args[0]
                   + " orderby dt Asc ";
    Cursor c1 = mDb.rawQuery(mySQL, null);
String mySQL =   " select dt" 
                   + " from reminders"
                   + " where dt > " + System.currentTimeMillis()
                   + " order by dt Asc ";
"Order by" not "orderby", long to string cast is automatic.
 long lowestDate = 0;
    long currentTime = System.currentTimeMillis(); 
    String CT = Long.toString(currentTime);
    String[] args = {CT};
    mDb = mDbHelper.getReadableDatabase();
    String mySQL =   " select dt" 
                   + " from reminders"
                   + " where dt > '" + args[0]
                   + "' orderby dt Asc ";
    Cursor c1 = mDb.rawQuery(mySQL, null);
try this
Try
 String mySQL =   "select dt" 
                       + " from reminders"
                       + " where dt > '" + args[0]
                       + "' orderby dt Asc";
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论