|
yanwei82123300 发表于 2012-6-26 15:59
Henry D. Sy 老师这个语句放到哪里或哪个位置,谢谢
try:- Public Function gDeliveryDay(sDate As Date, intPeriod As Integer) As Date
- Dim i As Integer, NWD As Integer
- Dim myDate As Date
- Dim gDate As Date
- For i = 1 To intPeriod
- myDate = DateAdd("d", i, sDate)
- If Weekday(myDate) = 1 Or Weekday(myDate) = 7 Then
- NWD = NWD + 1
- End If
- If Right(Format(myDate, "yyyymmdd"), 4) = "0501" Or Right(Format(myDate, _
- "yyyymmdd"), 4) = "0101" Or Right(Format(myDate, "yyyymmdd"), 4) = _
- "1001" Then
- NWD = NWD + 3
- End If
- Next
- gDate = DateAdd("d", intPeriod, sDate)
- If NWD = 0 Then
- gDeliveryDay = gDate
- Else
- gDeliveryDay = gDeliveryDay(gDate, NWD)
- End If
- End Function
复制代码 |
|