i am trying to query table that had valid from to fields using RDP methodology and the issue here that the Query object is returning all the valid from to rows which intersect with the valid from to ranges which means there no limit for the valid to values as below
worker | document no | valid from | valid to |
0001 | 121 | 1/1/2013 | 1/1/2014 |
0002 | 122 | 1/1/2013 | 1/1/2014 |
0003 | 123 | 15/1/2013 | 15/1/2014 |
the gray rows are in the valid from 1/1/2013 and valid to 1/1/2014
the green row dose not achieving the condition
the below is like the code which i am using in report processReport method in the RDP report class
_Query=this.parmQuery();
_QueryBuildDataSource=_Query.addDataSource(tableNum(TestTable));
_toRange=_QueryBuildDataSource.findRange(fieldNum(TestTable,ValidTo));
if(!_toRange)
{
_toRange=_QueryBuildDataSource.addRange(fieldNum(TestTable,ValidTo));
if(!_toRange.value())
_toRange.value(SysQuery::range(FromDate,ToDate));
}
_QueryRun=new QueryRun(_Query);
ttsBegin;
while (_QueryRun.next())
{
WorkerMedicalInsurance=_QueryRun.get(tableNum(TestTable));
if(TestTable)
{
temptable.worker= TestTable.worker;
temptable.worker= TestTable.ValidFrom;
temptable.worker= TestTable.ValidTo;
temptable.insert();
}
}
any suggestion how to solve that