以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助] (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=45185) |
||||
-- 作者:wangshuxin601 -- 发布时间:2014/1/17 16:55:00 -- [求助] c等于系统时间减去A或者B,如果A为空则减B,如果两者都为空则C为空
|
||||
-- 作者:wangshuxin601 -- 发布时间:2014/1/17 16:56:00 -- Select Case e.DataCol.name Case "A","B" If e.DataRow.IsNull("A") Then Dim v As String = e.DataRow("B") Dim dt As New Date(v.substring(0,4),1,1) Dim y,m,d As Integer DateYMD(dt,Date.Today,y,m,d) e.DataRow("c") = y Else Dim v As String = e.DataRow("A") Dim dt As New Date(v.substring(0,4),1,1) Dim y,m,d As Integer DateYMD(dt,Date.Today,y,m,d) e.DataRow("c") = y End If If e.DataRow.IsNull("B") And e.DataRow.IsNull("A") Then e.DataRow("c") = Nothing End If End Select
|
||||
-- 作者:Bin -- 发布时间:2014/1/17 17:10:00 -- .
|
||||
-- 作者:wangshuxin601 -- 发布时间:2014/1/17 17:19:00 -- 这样可以吗? Select Case e.DataCol.name Case "正科","副科" If e.DataRow.IsNull("副科") Then e.DataRow("同一级别时间") = Nothing Else If e.DataRow.IsNull("正科") Then Dim v As String = e.DataRow("副科") Dim dt As New Date(v.substring(0,4),1,1) Dim y,m,d As Integer DateYMD(dt,Date.Today,y,m,d) e.DataRow("同一级别时间") = y Else Dim v As String = e.DataRow("正科") Dim dt As New Date(v.substring(0,4),1,1) Dim y,m,d As Integer DateYMD(dt,Date.Today,y,m,d) e.DataRow("同一级别时间") = y End If End If End Select |
||||
-- 作者:Bin -- 发布时间:2014/1/17 17:20:00 -- 参考例子就没问题. |