以文本方式查看主题

-  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=96698)

--  作者:guimingze
--  发布时间:2017/2/26 17:32:00
--  关于年龄的计算未显示

If e.DataCol.name = "出生日期" Then
    If e.newvalue <> Nothing Then
        Dim y As Integer = e.NewValue.year
        If format(e.newvalue, "MMdd") <= Format(Date.Today, "MMdd") Then
            e.DataRow("年龄") = Date.Today.Year - y
        Else
            e.DataRow("年龄") = Date.Today.Year - y -1
        End If
    Else
        e.DataRow("年龄") = Nothing
    End If
End If


这里面是哪里出现问题了  老师 


--  作者:wyz20130512
--  发布时间:2017/2/26 18:57:00
--  
测试没问题呀?
--  作者:有点色
--  发布时间:2017/2/26 20:28:00
--  

 输入代码后,输入一个出生日期看看。

 

 或者是,直接重置列 http://www.foxtable.com/webhelp/scr/1469.htm