以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  上月日期  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=87911)

--  作者:zhangxl1964
--  发布时间:2016/7/22 12:49:00
--  上月日期
老师:你好!

         Dim QueryMonth As Date \'自定义日期
        Dim FirstDay As Date = New Date(QueryMonth.Year,QueryMonth.Month,1) \'第一天
        Dim LastDay As Date = New Date(QueryMonth.Year,QueryMonth.Month,Date.DaysInMonth(QueryMonth.Year,QueryMonth.Month)) \'最后一天

        要从自定义日期上取得上一月的第一天和上一月的最后一天,如何改写?

--  作者:大红袍
--  发布时间:2016/7/22 13:25:00
--  
        Dim QueryMonth As Date
        Dim LastDay As Date = New Date(QueryMonth.Year,QueryMonth.Month,1)
        Dim FirstDay As Date = LastDay.AddMonths(-1)