Xpath Error with month-from-dateTime

0
I am trying to create the following microflow in Mendix 2.5.6: [RecommendedStartDay >= month-from-dateTime('[%CurrentDateTime%]') and RecommendedFinishMonth <= month-from-dateTime('[%CurrentDateTime%]') and RecommendedStartDay >= day-from-dateTime('[%CurrentDateTime%]') and RecommendedFinishDay <= day-from-dateTime('[%CurrentDateTime%]')] But i keep getting the following error in the modeller: af: An exception has occurred for the following request(s): jH (depth = -1, amount = 5): //RecommendModule.SuggestedMaintenance[RecommendedStartDay >= month-from-dateTime('[%CurrentDateTime%]') and RecommendedFinishMonth <= month-from-dateTime('[%CurrentDateTime%]') and RecommendedStartDay >= day-from-dateTime('[%CurrentDateTime%]') and RecommendedFinishDay <= day-from-dateTime('[%CurrentDateTime%]')] Caused by: af: Exception occurred while retrieving data. (SQL State: 42567, Error Code: -5567) Detail Message: org.hsqldb.HsqlException: data type cast needed for parameter or null literal Caused by: java.sql.SQLException: data type cast needed for parameter or null literal at org.hsqldb.jdbc.Util.sqlException(Unknown Source) at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source) at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source) at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:281) at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:313) at aA.a(SourceFile:311) at aA.a(SourceFile:227) at aA.a(SourceFile:177) at aA.a(SourceFile:166) at iE.a(SourceFile:47) at gr.a(SourceFile:202) at gr.a(SourceFile:160) at gr.a(SourceFile:88) at lD.a(SourceFile:69) at jF.a(SourceFile:47) at jp.a(SourceFile:223) at eM.a(SourceFile:103) at eM.a(SourceFile:75) at eM.executeAction(SourceFile:24) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:49) at gs.execute(SourceFile:292) at jx.a(SourceFile:299) at jx.a(SourceFile:230) at jx.processRequest(SourceFile:174) at fI.a(SourceFile:71) at com.mendix.core.MxRuntime.processRequest(SourceFile:938) at com.mendix.m2ee.server.handler.RuntimeHandler.handle(RuntimeHandler.java:42) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) at org.eclipse.jetty.server.Server.handle(Server.java:334) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559) at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1007) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:209) at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) at java.lang.Thread.run(Thread.java:662) Caused by: org.hsqldb.HsqlException: data type cast needed for parameter or null literal at org.hsqldb.error.Error.error(Unknown Source) at org.hsqldb.error.Error.error(Unknown Source) at org.hsqldb.FunctionSQL.resolveTypes(Unknown Source) at org.hsqldb.FunctionCustom.resolveTypes(Unknown Source) at org.hsqldb.ExpressionLogical.resolveTypes(Unknown Source) at org.hsqldb.ExpressionLogical.resolveTypes(Unknown Source) at org.hsqldb.ExpressionLogical.resolveTypes(Unknown Source) at org.hsqldb.ExpressionLogical.resolveTypes(Unknown Source) at org.hsqldb.QuerySpecification.resolveExpressionTypes(Unknown Source) at org.hsqldb.QuerySpecification.resolveTypesPartOne(Unknown Source) at org.hsqldb.QueryExpression.resolve(Unknown Source) at org.hsqldb.ParserDQL.compileCursorSpecification(Unknown Source) at org.hsqldb.ParserCommand.compilePart(Unknown Source) at org.hsqldb.ParserCommand.compileStatement(Unknown Source) at org.hsqldb.Session.compileStatement(Unknown Source) at org.hsqldb.StatementManager.compile(Unknown Source) at org.hsqldb.Session.execute(Unknown Source) at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source) at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source) at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:281) at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:313) at aA.a(SourceFile:311) at aA.a(SourceFile:227) at aA.a(SourceFile:177) at aA.a(SourceFile:166) at iE.a(SourceFile:47) at gr.a(SourceFile:202) at gr.a(SourceFile:160) at gr.a(SourceFile:88) at lD.a(SourceFile:69) at jF.a(SourceFile:47) at jp.a(SourceFile:223) at eM.a(SourceFile:103) at eM.a(SourceFile:75) at eM.executeAction(SourceFile:24) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:49) at gs.execute(SourceFile:292) at jx.a(SourceFile:299) at jx.a(SourceFile:230) at jx.processRequest(SourceFile:174) at fI.a(SourceFile:71) at com.mendix.core.MxRuntime.processRequest(SourceFile:938) at com.mendix.m2ee.server.handler.RuntimeHandler.handle(RuntimeHandler.java:42) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) at org.eclipse.jetty.server.Server.handle(Server.java:334) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559) at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1007) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:209) at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) at java.lang.Thread.run(Thread.java:662) It seems to not work with the current date parameter and only works with date attributes.
asked
2 answers
0

For this kind of advanced queries you should switch to postgres or mssql databases, as they are probably not supported by HSQLDB.

answered
0

You can try [(commendedFinishMonth <= '[%CurrentDateTime%] + [%MonthLength%]'] [RecommendedFinishMonth <= '[%CurrentDateTime%] + [%MonthLength%]'] [RecommendedStartDay >= '[%CurrentDateTime%] + [%DayLength%]'] [RecommendedFinishDay <= '[%CurrentDateTime%] + [%DayLength%]']

answered