Hi ,
I have to select the records from HcmEmployment table where the validFrom field should be greater than or equal to the fromDate . I have written the below code but it is picking any record that is valid till toDate without checking the fromDate
fromDate = today();
toDate = today()+1;
legalEntity = 'gb01';
while select validTimeState(fromDate, toDate) hcmEmployment
where hcmEmployment.LegalEntity == CompanyInfo::findDataArea(legalEntity).RecId
join PersonnelNumber from hcmWorker where hcmWorker.RecId == hcmEmployment.Worker
{
info(strFmt("%1 ,%2,%3 ", hcmWorker.PersonnelNumber, DateTimeUtil::date(hcmEmployment.ValidFrom) ,
hcmEmployment.EmploymentType));
}

As you can see it is picking a record which has fromdate of 7/2/2017 and toDate till today .
*This post is locked for comments
I have the same question (0)