title: In google-app-engine: How to query all entries after specific date in GQL
body: <p>I'm trying to run a simple query from my java application:</p>
  
  <pre><code>SELECT * FROM Schedule where date &gt; DATETIME(2013,11,10)
  </code></pre>
  
  <p>if get the following error JSON response:</p>
  
  <pre><code>03-06 14:03:13.730: W/System.err(13272): com.google.api.client.googleapis.json.GoogleJsonResponseException: 503 Service Unavailable
  03-06 14:03:13.730: W/System.err(13272): {
  03-06 14:03:13.730: W/System.err(13272):   "code" : 503,
  03-06 14:03:13.730: W/System.err(13272):   "errors" : [ {
  03-06 14:03:13.730: W/System.err(13272):     "domain" : "global",
  03-06 14:03:13.730: W/System.err(13272):     "message" : "javax.persistence.PersistenceException: Problem with query &lt;SELECT FROM Schedule as Schedule WHERE date &gt; DATETIME(2013,11,10)&gt;: Unsupported method &lt;DATETIME&gt; while parsing expression: InvokeExpression{STATIC.DATETIME(Literal{2013}, Literal{11}, Literal{10})}",
  03-06 14:03:13.730: W/System.err(13272):     "reason" : "backendError"
  03-06 14:03:13.730: W/System.err(13272):   } ],
  03-06 14:03:13.730: W/System.err(13272):   "message" : "javax.persistence.PersistenceException: Problem with query &lt;SELECT FROM Schedule as Schedule WHERE date &gt; DATETIME(2013,11,10)&gt;: Unsupported method &lt;DATETIME&gt; while parsing expression: InvokeExpression{STATIC.DATETIME(Literal{2013}, Literal{11}, Literal{10})}"
  03-06 14:03:13.730: W/System.err(13272): }
  </code></pre>
  
  <p>this exact query works just fine when i run it from the admin console on app engine website
  'date' is a DateTime field and i have an index for it.
  on the app engine website the field looks like this: "2014-04-13 00:00:00"</p>
  
  <p>here is my code:</p>
  
  <pre><code>    EntityManager mgr = null;
      Cursor cursor = null;
      List&lt;Schedule&gt; execute = null;
  
      try {
          mgr = getEntityManager();
          Query query = mgr.createQuery("select from Schedule as Schedule "
                                      + "where date &gt; DATETIME(2013,11,10)");
          if (cursorString != null &amp;&amp; cursorString != "") {
              cursor = Cursor.fromWebSafeString(cursorString);
              query.setHint(JPACursorHelper.CURSOR_HINT, cursor);
          }
  
          if (limit != null) {
              query.setFirstResult(0);
              query.setMaxResults(limit);
          }
  
          execute = (List&lt;Schedule&gt;) query.getResultList();
          cursor = JPACursorHelper.getCursor(execute);
          if (cursor != null)
              cursorString = cursor.toWebSafeString();
  
          // Tight loop for fetching all entities from datastore and accomodate
          // for lazy fetch.
          for (Schedule obj : execute)
              ;
      } finally {
          mgr.close();
      }
  
      return CollectionResponse.&lt;Schedule&gt; builder().setItems(execute)
              .setNextPageToken(cursorString).build();
  </code></pre>
  
  <p>any help would me greatly appreciated </p>