I want to filter with OR Condition.

RecSPYPayrollDetails.SETFILTER(ValidFrom,’<=%1’,SPYPeriodStartDate); OR
RecSPYPayrollDetails.SETFILTER(ValidTo,’>=%1’,SPYPeriodEndDate);
IF RecSPYPayrollDetails.FIND(’-’) THEN REPEAT


UNTIL RecSPYPayrollDetails.NEXT=0

I am working on NAV 2016. How can I arrange this code.???

You filter will not work because when you compare two dates you have to check it within the loop.

IF RecSPYPayrollDetails.FIND(’-’) THEN begin

repeat

if (ValidFrom >= SPYPeriodStartDate) or (ValidTo <= SPYPeriodEndDate) then begin

<>

end;

until recspypayrolldetails.next = 0;

end;

about “I want to filter with OR Condition.” - just use FILTERGROUP(-1)

Read more by link like https://community.dynamics.com/nav/b/navvanvugts/archive/2015/05/30/filtergroup-1 or

docs.microsoft.com/…/filtergroup-function–record-