确定某日在当月是第几个星期几的代码
时 间:2010-05-24 08:13:48
作 者:咱家是猫 ID:85 城市:广州
摘 要:确定某日在当月是第几个星期几的代码
正 文:
Private Function GetWeekDayStr(SolarDate As Date, m As Byte, n As Byte, w As Byte) As String
'根据日期查询是当月的第几周的周几
Dim tempDate As Date, tempW As Integer
tempDate = DateSerial(Year(SolarDate), Month(SolarDate), 1)
tempW = Weekday(tempDate)
m = Format(SolarDate, "mm")
n = Format(SolarDate, "WW") - Format(tempDate, "WW") + 1
w = Weekday(SolarDate)
If tempW > w Then n = n - 1
End Function
Sub test()
Dim d As Date, m As Byte, n As Byte, w As Byte
d = #1/18/2009#
Call GetWeekDayStr(d, m, n, w)
Debug.Print d & "是" & m & "月的第" & n & "个" & WeekdayName(w)
End Sub
Access软件网官方交流QQ群 (群号:483923997) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- 【Access窗体导出PDF】...(04.08)
- 【Access窗体导出PDF】...(04.07)
- Access两种方式实现即时更...(03.01)
- Access隐藏与显示lacc...(01.12)
- 【Access高效办公】将每个...(12.23)
- Access21点游戏源代码(12.13)
- 【Access窗体导出Exce...(11.15)
- 【Access开发】Acces...(11.14)
- 通过Access宏录入数据到选...(11.10)
学习心得
最新文章
- Access日期格式的数据导出Ex...(04.28)
- ACCESS精华集锦资料.CHM(04.25)
- Access VBA语句If Me...(04.24)
- 【Access修改记录示例】编辑选...(04.22)
- 【Access表名称命名建议】将A...(04.20)
- Access学习笔记--用Acce...(04.19)
- 【Access重复项查询示例】将A...(04.17)
- Access快速开发平台企业版--...(04.16)
- 【Access模块示例】通过模块代...(04.15)
- Access查询里面分组合计功能添...(04.13)