|
Select Case 完成时间类型
Case Is = "近7天" '近7天
'当期
start_Date = Format(Now() - 6, "yyyymmdd")
end_Date = Format(Now(), "yyyymmdd")
'上期
start_Date_1 = Format(Now() - 13, "yyyymmdd")
end_Date_1 = Format(Now() - 7, "yyyymmdd")
Case Is = "近14天" '近14天
'当期
start_Date = Format(Now() - 13, "yyyymmdd")
end_Date = Format(Now(), "yyyymmdd")
'上期
start_Date_1 = Format(Now() - 23, "yyyymmdd")
end_Date_1 = Format(Now() - 14, "yyyymmdd")
Case Is = "近30天" '近14天
'当期
start_Date = Format(Now() - 29, "yyyymmdd")
end_Date = Format(Now(), "yyyymmdd")
'上期
start_Date_1 = Format(Now() - 59, "yyyymmdd")
end_Date_1 = Format(Now() - 30, "yyyymmdd")
Case Is = "本周" '本周
start_Date = Format(Now() - Weekday(Now(), 2) + 1, "yyyymmdd")
end_Date = Format(Now(), "yyyymmdd")
'上期
start_Date_1 = Format(Now() - Weekday(Now(), 2) - 6, "yyyymmdd")
end_Date_1 = Format(Now() - 7, "yyyymmdd")
Case Is = "本月" '本月
'当期
start_Date = Format(Now(), "yyyymm") & "01"
end_Date = Format(Now(), "yyyymmdd")
'上期
start_Date_1 = Format(CDate(Format(Now(), "yyyy/mm/") & "01") - 1, "yyyymm") & "01"
end_Date_1 = Format(DateAdd("m", -1, CDate(Format(Now(), "yyyy/mm/dd"))), "yyyymmdd")
Case Is = "上月" '
'当期
start_Date = Format(CDate(Format(Now(), "yyyy/mm/") & "01") - 1, "yyyymm") & "01"
end_Date = Format(CDate(Format(Now(), "yyyy/mm/") & "01") - 1, "yyyymmdd")
'上期
start_Date_1 = Format(CDate(Format(Now(), "yyyy/mm/") & "01") - 2, "yyyymm") & "01"
end_Date_1 = Format(CDate(Format(Now(), "yyyy/mm/") & "01") - 2, "yyyymmdd")
Case Is = "本年" '本年
'当期
start_Date = Format(Now(), "yyyy") & "0101"
end_Date = Format(Now(), "yyyymmdd")
'同期
start_Date_1 = Format(Now(), "yyyy") - 1 & "0101"
end_Date_1 = Format(DateAdd("m", -12, CDate(Format(Now(), "yyyy/mm/dd"))), "yyyymmdd")
End Select |
评分
-
1
查看全部评分
-
|