Hello all,
I've a runbasebatch class which use a simple query object like this:
SELECT COUNT(T1.RECID),SUM(T2.QTY),SUM(T2.COSTAMOUNTPOSTED),SUM(T2.COSTAMOUNTADJUSTMENT),COUNT(T2.RECID) FROM (SELECT TOP (2147483647) 1 AS RecId FROM INVENTTABLE T1 CROSS JOIN INVENTTRANS T2 CROSS JOIN INVENTTRANSORIGIN T3 WHERE ((T1.PARTITION=?) AND (T1.DATAAREAID=?)) AND (((T2.PARTITION=?) AND (T2.DATAAREAID=?)) AND (((T2.STATUSISSUE=?) OR (T2.STATUSISSUE=?)) AND (T2.ITEMID=T1.ITEMID))) AND (((T3.PARTITION=?) AND (T3.DATAAREAID=?)) AND ((T3.REFERENCECATEGORY=?) AND (T2.INVENTTRANSORIGIN=T3.RECID))) GROUP BY T1.ITEMID ORDER BY T1.ITEMID ) AS T1
The query is an inner join, group by itemId on Inventtable, inventtrans and inventransorigin, fetch mode 1:1
I get the SQL error trying to add new value range to the query in the run() method:
qbr = SysQuery::findOrCreateRange(qr.query().dataSourceTable(tableNum(inventTrans)), fieldNum(inventTrans, DateFinancial));
qbr.value(SysQuery::range(fromDate, toDate)); <---
If I don't add the qbr.value instruction all works fine, but unfortunately I have to override the Datefinancial with a new range
Any idea?
KR
PS: This is the query definition: