problem with sql query in android application,
<p>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. </p>

<p>I've tried this query, but it causes my app to force close. I'm not sure whether the problem is the where clause part or the orderby clause part or both.</p>

<p>Here is what I done, your help would be most appreciative.</p>

<blockquote>
  <p>long lowestDate = 0;</p>
  
  <p>long currentTime = System.currentTimeMillis(); </p>
  
  <p>String CT = Long.toString(currentTime);</p>
  
  <p>String[]c = {CT};</p>
  
  <p>mDb = mDbHelper.getReadableDatabase();</p>
  
  <p>String[] dates = {KEY_DT};</p>
  
  <p>Cursor getDate = mDb.query(DATABASE_TABLE, dates, dates + "> ?", c, null, null, dates + "ASC");</p>
  
  <p>getDate.moveToFirst();</p>

<pre><code>  while(getDate.isAfterLast() == false)
    {
        lowestDate = getDate.getLong(0);
        getDate.moveToNext();
    }
</code></pre>
</blockquote>
