I've got the following code:

PersistenceManager pm = PMF.get().getPersistenceManager();

query = "select from " + Email.class.getName() + " where groupName ==
'" + group + "' && date_sent >= "+fromStr+" && date_sent <= "+toStr
+"";

List<Email> emails = (List<Email>) pm.newQuery(query).execute();

messageSent = emails.size();

pm.close();


What I want to do is simply return all messages between fromStr and
toStr.

I've tried stuff like String fromStr = "DATETIME('1900-01-01
00:00:00')"; but I get an error message with that:

Uncaught exception from servlet
org.datanucleus.store.appengine.query.DatastoreQuery
$UnsupportedDatastoreFeatureException: Problem with query <SELECT FROM
com.hookmeup.Email WHERE groupName == 'jan2' && date_sent >=
DATETIME('1900-01-01 00:00:00') && date_sent <= DATETIME('2011-01-01
00:00:00')>: Unsupported method <DATETIME> while parsing expression:
InvokeExpression{[null].DATETIME(Literal{1900-01-01 00:00:00})}
[.....]

I've tried just '1900-01-01 00:00:00' but that didn't work either.
I've I build a query by hand near the dashboard on the webinterface, I
can use datetime just fine. I'm out of ideas. Help?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to