I need to grab some records from a MySQL table which has a Column posted_date which is a Timestamp. I need to filter records by comparing against month only. For example I want all the records posted this month only.
I tried as given in this link Hibernate query date compare on year and month only
But I get following error
line 1:106: unexpected token: to_char
at org.hibernate.hql.internal.antlr.HqlBaseParser.queryRule(HqlBaseParser.java:769)
How to compare only with month in HQL by taking month as parameter?