We have a from date and To date in Table fields.
We are getting an int value(Tot days) by using minus of To date from From Date.
Totdays = Todate – FromDate;
Up to here it is fine but problem arises if we have weekdays in the range between from date to Todate.
How to write X++ code to deduct weekdays in the range and get TotDays based on workingdays.
Days between two dates not counting Saturday and Sunday:
The count is negative if d2 is less than d1, but it may not be what you expect.