This is my query and associative variables:
public static final String DATABASE_NAME = "HDL_db";
public static final String TABLE_NAME = "HDL_table";
public static final String COL_3 = "Arrival_Time";
public static final int database_version = 1;
public String CREATE_QUERY = "CREATE TABLE " + TABLE_NAME + " (" +
COL_3 + " DATE)";
This is the resultant query format in SQLite Manager (Mozilla Firefox add-on):
CREATE TABLE HDL_table(Arrival TimeDATE)
should be:
CREATE TABLE HDL_table (Arrival_Time DATE) [based on spaces I have added in original query]
and so leaves me with the following table structure in SQLite Manager:
SQLite Manager Table Structure
I want to have the 'Name' column set to 'Arrival_Time' and the 'Type' set to 'DATE' .. because it will be a date that workers arrive on site.
Personally, I think the spaces in the query are the problem, however when I add in the spaces in the original query, export and run the database file through SQLite Manager and check the resultant table structure .. it is in the wrong format.
Any help with this would be great, thanks.
In your column's name must not contain spaces. SQLite does not have a storage class set aside for storing dates and/or times. Instead, the built-in Date And Time Functions of SQLite are capable of storing dates and times as TEXT, REAL, or INTEGER values:
"CREATE TABLE IF NOT EXISTS HDL_table (_id integer primary key, arrival_time text)"