Hi everyone,
I have to write in Ax a query like this:
SELECT a.ORDERNUM, a.CHARGESPROGRESSLINETYPE, SUM(Ordered) as Ordered , SUM(Statutory) as statutory, SUM(Accerted) as Accerted FROM ATestTable_SAM a GROUP BY a.CDR,a.MainAccount, a.ItemId, a.Year, a.startDate, a.endDate, a.TransDate, a.PostDate, a.OrderNum, a.BudgetTotal, a.BudgetSourceTrackingStatus, a.ProjId, a.ProjName having ((sum(ORDERED) !=0) or (sum(Accerted) !=0) or (sum(statutory) !=0))
I do not want to see in my form the lines that have sum(ordered) and sum(Accerted) and sum(Statuory) zero,
so at least one of this sums has to be not zero.
I am trying use the QueryHavingFilter, but I am not finding a way how to use the or condition as In SQL.
queryHavingFilter = fds.query().addHavingFilter(qbds, fieldStr(ATestTable_SAM, Ordered),AggregateFunction::Sum); queryHavingFilter.value(SysQuery::valueNot(0));
Can I use an expression like in queryRange :
qbr.value((strFmt('(((%1 != %4)|| (%2 != %4)|| (%3 != %4)))',
fieldStr(ATestTable, Ordered),
fieldStr(ATestTable, Accerted),
fieldStr(ATestTable, Statutory),
queryValue(0))));
Thank you,
Enxhi
*This post is locked for comments