日期改为显示星期几的自定义涵数
时间:2006-10-22 22:17 来源:Access开发者 作者:未知 阅读:次
Function DateOfWeek(ByVal Yearf As Integer, ByVal Weekf As Integer, Optional ByVal Dayf As Integer = 1, Optional ByVal FirstDayOfWeek As Integer = 0)
On Error GoTo ext
Dim fd As Date, fw%
fd = DateValue(Yearf & "-1-1")
fw = Weekday(fd)
FirstDayOfWeek = FirstDayOfWeek Mod 7
DateOfWeek = fd + 7 * (Weekf - 1) + Dayf - IIf(Weekf = 1, 1, fw - FirstDayOfWeek)
Exit Function
ext:
DateOfWeek = "#N/A"
End Function
(责任编辑:admin)
顶一下
(0)
0%
踩一下
(0)
0%
最新内容