以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 计算年龄(已上传附件) (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=96709) |
||||||
-- 作者:guimingze -- 发布时间:2017/2/26 22:54:00 -- 计算年龄(已上传附件)
[此贴子已经被作者于2017/2/26 22:56:35编辑过]
|
||||||
-- 作者:y2287958 -- 发布时间:2017/2/26 23:26:00 -- DataColChanged事件,试试这个 If e.DataCol.name = "出生年月" Then If e.DataRow.IsNull("出生年月") = False If Date.Today.Month >= CInt(e.DataRow("出生年月").split(".")(1)) e.DataRow("年龄") = Date.Today.Year - CInt(e.DataRow("出生年月").split(".")(0)) Else e.DataRow("年龄") = Date.Today.Year - CInt(e.DataRow("出生年月").split(".")(0)) -1 End If Else e.DataRow("年龄") = Nothing End If End If
|
||||||
-- 作者:guimingze -- 发布时间:2017/3/5 22:17:00 -- 回复:(y2287958)DataColChanged事件,试试这个If e... 老师辛苦了, 正是我需要的效果,最近工作忙没及时看到论坛老师写的,谢谢 |