现在的位置: 首页 > 综合 > 正文

计算当前日期是任意时间段内第几周的函数

2012年03月16日 ⁄ 综合 ⁄ 共 333字 ⁄ 字号 评论关闭

作者:Iasky | 文章出处:未知 | 阅读次数:10 | 发布日期:2005-03-26

前几天我问过,今天写出来了!!
Function CalculateWeekNo(BeginDate,EndDate,InputDate)
dim
wdate(500,8)
z=0
x=0
strlong=len(CStr(inputdate))-9
inputdate=cdate(left(CStr(inputdate),strlong))
for i=cdate(BeginDate) to cdate(EndDate)
if inputdate=i then
x=z
Exit For
end if
if weekday(i)=7 then
z=z+1
end if
next

CalculateWeekNo=x
end Function

抱歉!评论已关闭.