以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  怎样对时间进行相加  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=168766)

--  作者:探狐
--  发布时间:2021/5/22 20:53:00
--  怎样对时间进行相加
 “留样保存至”和“留样日期”列都是DateTime格式
 “留样保存至”等于“留样日期”+48小时,如何修改


Dim dr As DataRow = e.DataRow
        If dr.IsNull("留样日期")   Then
           dr("留样保存至") = Nothing
        Else
            Dim dt As Date = dr("留样日期")
            dr("留样保存至") = dt + #48:00:00 # 
        End If


--  作者:cnsjroom
--  发布时间:2021/5/22 21:33:00
--  回复:(探狐)怎样对时间进行相加
Dim dr As DataRow = e.DataRow
If dr.IsNull("留样日期")   Then
    dr("留样保存至") = Nothing
Else
    Dim dt As Date = dr("留样日期")
    dr("留样保存至") = dt.AddHours(48)
End If


--  作者:有点蓝
--  发布时间:2021/5/23 20:52:00
--  
参考:http://www.foxtable.com/webhelp/topics/1337.htm