//DaysDifference...Gives me the number of days
WhilePrintingRecords;
Global NumberVar TotalDaysToCompletion;
Global NumberVar WorkOrderCount;
Local NumberVar DaysDiff;
Global DateVar Array Holidays;
Local NumberVar FullDays;
Local NumberVar BankHolidays;
Local NumberVar Weekends;
Local NumberVar i;
Local Datevar StartDate := {WOHeader.RequestDate};//put your date here;
Local DateVar EndDate := {WOHeader.ComplDate};
(
//Count the number of full days between dates
Fulldays := DateDiff ('d',StartDate,EndDate);
//Count any holidays between dates
For i := 1 to Ubound(holidays)
Do
If Holidays[i] >= StartDate and Holidays[i] <= EndDate Then
BankHolidays := BankHolidays + 1;
//Count any weekends between dates
Weekends := DateDiff("ww", StartDate, EndDate, crsaturday) +
DateDiff("ww", StartDate, EndDate, crsunday)
);
//Calculate Working days
DaysDiff := FullDays - Weekends - BankHolidays;
TotalDaysToCompletion := TotalDaysToCompletion + DaysDiff;
WorkOrderCount := WorkOrderCount + 1;
DaysDiff
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE