以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  判断日期列是当前的年月  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=139580)

--  作者:nbsugu_z
--  发布时间:2019/8/16 10:57:00
--  判断日期列是当前的年月
If e.Col.Name = "付款时间" Then
    If e.Row.IsNull("付款时间") = False
        If e.Row("还款或付息日期") = Date.month
            e.Style = "付息提醒"
        End If
    End If
End If

老师,我要判断上面加粗的一行代码,判断日期列的年月=当前(系统)的年月 (不要具体日),该如何写? 对日期我一直搞不清楚。



--  作者:有点蓝
--  发布时间:2019/8/16 11:26:00
--  
方法1:If format(e.Row("还款或付息日期"),"yyyyMM") = format(date.today,"yyyyMM")

2、dim d as date = e.Row("还款或付息日期")
if d.year = date.today.year andalso d.month= date.today.month