Solved SQLite - Checking if DATETIME is longer then one month ago

Discussion in 'Plugin Development' started by Bammerbom, Jun 15, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Bammerbom

    This is the Update I try to do:
    Code:
    "DELETE FROM BLOCKDATA WHERE TIME <= DATEADD(MONTH, -1, GETDATE());"

    But it fails with the error: "SQLException: no such column: month"
    The table:
    Code:
          String sql = "CREATE TABLE BLOCKDATA " +
                  " (ID    INTEGER PRIMARY KEY, " +
                  " PLAYERID          TEXT    NOT NULL, " +
                  " TIME          DATETIME    NOT NULL, " +
                  " LOCATION          TEXT    NOT NULL, " +
                  " ACTION            TEXT    NOT NULL, " +
                  " SPECIAL        TEXT, " +
                  " SPECIAL2        TEXT)"; 
     
  2. Offline

    mazentheamazin

    Bammerbom
    Its pretty self explanatory, there is no such column month, if you look at the create table statement. To be exact, the columns of the table are:
    PLAYERID, TIME, LOCATION, ACTION, SPECIAL, SPECIAL2
     
  3. Offline

    Bammerbom

    mazentheamazin
    I putten the table creating there so you can see how my Table looks.
    I am trying to check if the datetime (TIME) is longer then one month ago.
     
Thread Status:
Not open for further replies.

Share This Page