title: Android SQLite CREATE TABLE not working
body: <p><strong>CREATE TABLE is not creating table</strong></p>
  
  <p>From here I am taking table name</p>
  
  <pre><code>private static  String getTableName() {
      Calendar calendar = Calendar.getInstance();
      calendar.setTimeZone(TimeZone.getTimeZone("Asia/Calcutta"));
      SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
      String date = df.format(calendar.getTime());
      return date;
  }
  
  
  //table name
  private String TABLE_DATE = getTableName();
  </code></pre>
  
  <p>Here is the code to create table</p>
  
  <pre><code>@Override
  public void onCreate(SQLiteDatabase db) {
      String CREATE_ENTRY_TABLE = "CREATE TABLE " +TABLE_DATE + "("
              + KEY_ID + " INTEGER PRIMARY KEY," + KEY_ROLL + " TEXT,"
              + KEY_DATE + " TEXT," +  KEY_TIME + " TEXT" + ")";
      db.execSQL(CREATE_ENTRY_TABLE);
  }
  </code></pre>
  
  <p>Error</p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jagdishchoudhary.iitgandhinagarmesssystem/com.jagdishchoudhary.iitgandhinagarmesssystem.MainActivity}: android.database.sqlite.SQLiteException: near "20180119": syntax error (code 1): , while compiling: CREATE TABLE  20180119(id INTEGER PRIMARY KEY,Roll TEXT,Date TEXT,Time TEXT)
                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659)
                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
                                                 at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                 at android.os.Looper.loop(Looper.java:154)
                                                 at android.app.ActivityThread.main(ActivityThread.java:6123)
                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
                                              Caused by: android.database.sqlite.SQLiteException: near "20180119": syntax error (code 1): , while compiling: CREATE TABLE  20180119(id INTEGER PRIMARY KEY,Roll TEXT,Date TEXT,Time TEXT)
  </code></pre>
  
  <p>Please see the logcat.</p>