如何计算出当前日期属于定义时间段内的第几星期?
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 [1] |
请发表评论