Why not try what I do in this situation: use parameters so that one
does not have to use strings for date values (use Date values
instead)? Why not give the following snippet a go?
PersistenceManager pm = PMF.get().getPersistenceManager();
Object[] aobjParams = new Object[3];
aobjParams[0] = group; // Your already-listed (String?) object
aobjParams[1] = new Date(...); // "From" date
aobjParams[2] = new Date(...); // "To" date
Query qry = pm.newQuery(Query.JDOQL, null);
qry.setClass(Email.class);
qry.setFilter("(groupName == p1) && (date_sent >= p2) && (date_sent
<= p3)");
qry.declareParameters("String p1, java.util.Date p2, java.util.Date
p3");
List<Email> emails = (List<Email>)qry.executeWithArray(aobjParams);
messageSent = emails.size();
pm.close();
(I personally wrap all my queries within a transaction. I do not know
if you do here.)
Do let me know how you get on with this.
--
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.