老师:你好!
1 Dim QueryMonth As Date '自定义日期
2 Dim FirstDay As Date = New Date(QueryMonth.Year,QueryMonth.Month,1) '第一天
3 Dim LastDay As Date = New Date(QueryMonth.Year,QueryMonth.Month,Date.DaysInMonth(QueryMonth.Year,QueryMonth.Month)) '最后一天
4 Dim sFirstDay As Date = New Date(QueryMonth.Year,QueryMonth.Month-1,1) '上月第一天
5 Dim sLastDay As Date = New Date(QueryMonth.Year,QueryMonth.Month-1,Date.DaysInMonth(QueryMonth.Year,QueryMonth.Month-1)) '上月最后一天
Dim QueryMonth As Date ='2016-01-01'时,执行时4,5 弹出转化错误,
怎样修改成跨年度通用的当前日期的转化为上月的日期?