I have written a function to calculate the next working .
My parameters is Fromdate and No of Days .
GetTheNextDay(FromDate : Date;NoofDays : Integer) : Date
ToDate:=0D;
ToDate:=CALCDATE(FORMAT('<'+FORMAT(NoofDays)+'D>'),FromDate);
TempDate.RESET;
TempDate.SETRANGE("Period Type",TempDate."Period Type"::Date);
TempDate.SETRANGE("Period Start",FromDate,ToDate);
IF TempDate.FINDSET THEN BEGIN
REPEAT
IF (CUCalMgmnt.CheckDateStatus(CompInfo."Base Calendar Code",TempDate."Period Start",TempDescription)) THEN
ToDate+=1;
UNTIL TempDate.NEXT =0;
END;
EXIT(ToDate);
Input:27/12/16,5
output:03/01/17;
it is giving one extra day
i have already checked my base calender in which there is only one sunday between my date range.
How is this possible?
*This post is locked for comments