Hello all,
I have a DetachedCriteria on which I am trying to add a restriction. Essentially I want the following SQL where clause:
-- but I can't seem to find the proper syntax for this restriction:Code:WHERE MONTH(someDate) = <some month integer value>
I've seen sqlRestriction which I think I could use to solve this problem, but I'm interested to learn how (if possible) this can be used with the eq restriction.Code:crit.add(Restrictions.eq("month(someDate)", cal.get(GregorianCalendar.MONTH)));
Thanks


Reply With Quote