Select data from current month in android with SQLite
<p>In my App I am trying to show balance for current month but I can't accomplish that.</p>

<p>This is my code</p>

<pre><code>// Count Current Month Income
public float CurrentMonthIncome(){
    float x = 0;
    SQLiteDatabase db = getReadableDatabase();
    String getamountdata = "SELECT SUM(inc_amount) AS totalInc FROM "+ TABLE_ENTRY + " where year(entry_date)= year(CURDATE()) and MONTH(entry_date)=MONTH(CURDATE())";
    Cursor c = db.rawQuery(getamountdata, null);
    if(c.moveToFirst()){
        x = c.getFloat(0);
    }
    return x;

}
</code></pre>

<p>When I execute that code, I get an exception like </p>

<pre><code>E/SQLiteLog: (1) no such function: CURDATE
Shutting down VM
FATAL EXCEPTION: main
</code></pre>