标题: 自定义结帐年月 [打印本页] 作者: netguestcn 时间: 2012-7-14 20:01 标题: 自定义结帐年月 结帐月份为上月25日到下月24日
Function 结帐年月(Mdate As Date)
'结帐年月(#2012-6-26#)
Dim D, M, Y As Long
D = Day(Mdate)
M = Month(Mdate)
Y = Year(Mdate)
Myyear = IIf(M = 12 And D > 24, Y + 1, Y)
Mymonth = IIf(IIf(D > 24, M + 1, M) > 12, 1, IIf(D > 24, M + 1, M))
结帐年月 = Myyear & "-" & Mymonth
End Function