'''''''''''''''''''
'照你意思写了段代码,两个日期的生成由你处理,下面的代码希望符合你的要求
'''''''''''''''''''
Dim date1 As Date
Dim date2 As Date
Dim date3 As String
Dim intDay As Integer
date1 = "2008/4/16"
date2 = "2008/4/18"
intDay = Abs(DateDiff("d", date1, date2))
If intDay < 3 Then
If intDay = 0 Then
date3 = ""
ElseIf Weekday(CDate(Year(date1) & "/" & Month(date1) & "/" & intDay)) = vbSunday Then
date3 = DateAdd("d", -1, CDate(Year(date1) & "/" & Month(date1) & "/" & intDay))
Else
date3 = CDate(Year(date1) & "/" & Month(date1) & "/" & intDay)
End If
End If
[[it] 本帖最后由 zougonghua 于 2008-5-5 15:41 编辑 [/it]]