如何用代码求年月?
学习并使用了表达式求年、月,但不知如何用代码求年、月。
请指教,或指示例子出处。
用表达式计算年月
http://www.foxtable.com/help/topics/1285.htm
谢谢大家,原来用代码求年月比表达式更好,更容易领会。
If e.DataCol.Name = "住院号" Then
If e.DataRow.IsNull("住院号") Then
e.DataRow("sys_简码") = Nothing
e.DataRow("sys_年") = Nothing
e.DataRow("sys_月") = Nothing
Else
e.DataRow("sys_简码") =left(e.DataRow("患者姓名"),1)
e.DataRow("sys_年") =year(e.DataRow("开嘱日期"))
e.DataRow("sys_月") =month(e.DataRow("开嘱日期"))
End If
End If