Skip to Content
0
Former Member
Apr 27, 2015 at 04:05 PM

How to compare date in hsql query

603 Views

OrderHeader table has a column OrderedDate of type java.util.Date . I am trying to query this table using :-

SELECT * FROM {OrderHeader} WHERE {customerAccountID}=8043 AND {OrderedDate} < (SYSDATE-7)

It gives me an error :-

Exception message: incompatible data types in combination Exception stacktrace: org.hsqldb.jdbc.Util.sqlException(Unknown Source) org.hsqldb.jdbc.Util.sqlException(Unknown Source) org.hsqldb.jdbc.JDBCPreparedStatement.(Unknown Source) org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source) de.hybris.platform.jdbcwrapper.ConnectionImpl.prepareStatement(ConnectionImpl.java:583) de.hybris.platform.hac.facade.impl.DefaultFlexibleSearchFacade.getPreparedStatement(DefaultFlexibleSearchFacade.java:230) de.hybris.platform.hac.facade.impl.DefaultFlexibleSearchFacade.executeFlexibleSearchQuery(DefaultFlexibleSearchFacade.java:85) de.hybris.platform.hac.controller.console.FlexibleSearchController.executeFlexsearch(FlexibleSearchController.java:112) sun.reflect.GeneratedMethodAccessor737.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) org.springframework.web.method.support.InvocableHandle

What could be the mistake ?