我已经修改了这个访问功能,所以我可以根据工作日的数量计算出结束日期。
但是,我还需要考虑英国的银行假期。
有人知道我该怎么做吗?
Public Function CountDays(startDate As Date, NoOfDays As Integer) As Date
' Function to count no of working days
Dim tmpNo As Integer
Dim tmpDate As Date
Dim tmpStartDate As Date
Dim i As Integer
tmpNo = NoOfDays
tmpStartDate = startDate
tmpDate = startDate
i = 0
Do Until i = NoOfDays
If Weekday(tmpDate) = 1 Or Weekday(tmpDate) = 7 Then
tmpNo = tmpNo + 1
Else
i = i + 1
End If
tmpDate = tmpDate + 1
Loop
CountDays = DateAdd("d", tmpNo, tmpStartDate)
End Function
干杯
罗斯