Search code examples
androidsqliteandroid-sqliteandroid-sql

Android SQLite is it today


This my Table codes

CREATE TABLE  InformationTable"
            + "(ID INTEGER, "
            + " ConfirmDate TEXT , "
            +" Counter INTEGER DEFAULT 99999"
            +" )";

I want to a select query about InformationTable. I want to create query like this ;

Select * from InformationTable where datetime(ConfirmDate) IS IT TODAY()

How can i do it ?


Solution

  • If your date is stored as TEXT ISO8601 strings ("YYYY-MM-DD HH:MM:SS.SSS"), to select the rows for today:

    select * from InformationTable where date(ConfirmDate) == date('now');