Hi
I have added three tables as report data source (InventTable, InventTrans, InventDim)
then I added date field to the dialog
and I want to add this date filter to the current query
I have created this method
private Query buildPeriodQuery() { QueryBuildDataSource queryBuildDataSource; QueryBuildRange queryBuildRange; Query queryBuild; ; queryBuild = new Query(this.query().pack()); queryBuildDataSource = queryBuild.dataSourceTable(tablenum(InventTrans)); queryBuildRange = SysQuery::findOrCreateRange(queryBuildDataSource, fieldnum(InventTrans, DatePhysical)); queryBuildRange.value(queryRange("", toDate)); info(queryBuildDataSource.toString()); return queryBuild; }
Then I called it in getFromDialog
public boolean getFromDialog() { ; toDate = dlgToDate.value(); this.buildPeriodQuery(); return true; }
and this is the query result
SELECT FIRSTFAST * FROM InventTrans WHERE InventTable.ItemId = InventTrans.ItemId AND ((DatePhysical<={ts '2021-02-01 00:00:00.000'})) JOIN FIRSTFAST * FROM InventDim WHERE InventTrans.inventDimId = InventDim.inventDimId
But the date filter does not affect the report result
Thanks in advance.