Advertisement
6_2008-2009 Math/ Dates #196781

RemoveWeekEnds

Returns number of business days from a start date and total number of days. There are more pieces coming. Building a routine that calculates holidays and weekends to tell you strictly business days.

AI

KI-Zusammenfassung: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Quellcode
original-source
Public Function RemoveWeekends(strStartDate As String, intNumberOfDays) As Integer
  Dim i As Integer
  
  For i = 0 To intNumberOfDays
    Select Case Weekday(DateAdd("d", i, CDate(strStartDate)))
      Case vbSaturday, vbSunday
        intNumberOfDays = intNumberOfDays - 1
    End Select
  Next i
  RemoveWeekends = intNumberOfDays
End Function
Originalkommentare (3)
Wiederhergestellt von der Wayback Machine