Access开发培训
网站公告
·Access专家课堂QQ群号:151711184    ·Access快速开发平台下载地址及教程    ·欢迎加入Access专家课堂微信群!    ·如何快速搜索本站文章|示例|资料    
您的位置: 首页 > 技术文章 > Access数据库-模块/函数/VBA

[函数]得到一个日期当月最后一天是星期几

时 间:2009-02-10 12:44:08
作 者:钱玉炜   ID:16  城市:江阴
摘 要:[函数]得到一个日期当月最后一天是星期几
正 文:

Function getYMweekday(sDate As Date) As String

Dim intY As Integer
Dim intM As Integer

intY = Year(sDate)
intM = Month(sDate)
getYMweekday = WeekdayName(Weekday(DateSerial(intY, intM, 1)))

End Function

得到一个日期当月最后一天是星期几

Function getYMweekdayEnd(sDate As Date) As String

Dim intY As Integer
Dim intM As Integer

intY = Year(sDate)
intM = Month(sDate)
getYMweekdayEnd = WeekdayName(Weekday(DateSerial(intY, intM + 1, 0)))

End Function


Sub aa()
Debug.Print getYMweekday(Date)
Debug.Print getYMweekdayEnd(Date) 'date为2007-12-3
End Sub

 



Access软件网官方交流QQ群 (群号:483923997)       Access源码网店

常见问答:

技术分类:

相关资源:

专栏作家

关于我们 | 服务条款 | 在线投稿 | 友情链接 | 网站统计 | 网站帮助