24/02/2024

1 thought on “Working Days in Date Calculation

  1. a more simple example…

    CalcNextWorkingDay(StartDate : Date;Days2Add : Integer) : Date
    InGG :=0;
    RcData.RESET;
    RcData.SETRANGE(“Period Type”,RcData.”Period Type”::Date);
    RcData.SETFILTER(“Period Start”,’%1..%2′,StartDate,EndingDate);
    RcData.FINDSET;
    REPEAT
    IF NOT CalendarMgmt.CheckDateStatus(CodiceCalendarioBase,RcData.”Period Start”,Description) THEN
    InGG += 1;

    UNTIL (RcData.NEXT = 0) OR (InGG = Days2Add);
    EXIT(RcData.”Period Start”);

Comments are closed.