Herer is a native query that will probably work
Query query = em.createNativeQuery("SELECT id FROM table WHERE MONTH( DATE(timestamp1) - DATE(timestamp2) ) > 3 ");
List resultRows = query.getResultList();
for (Iterator it = resultRows.iterator(); it.hasNext(); ) {
Vector resultRow = (Vector) it.next();
Integer id = (Integer) resultRow.elementAt(0);
...
}
[Message sent by forum member 'bbergquist' (bbergquist)]
http://forums.java.net/jive/thread.jspa?messageID=317899