以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]日期计算  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=139534)

--  作者:seal51
--  发布时间:2019/8/15 9:51:00
--  [求助]日期计算
If e.DataCol.Name = "交货日期" Then
    If e.DataRow.IsNull("交货日期") Then
        e.DataRow("倒计时") = Nothing
    Else
        e.DataRow("倒计时") = (Cdate(e.DataRow("交货日期")) - Date.Today).TotalDays
    End If
End If 

如何加一个条件, 在倒角时=100天的时候停止计算并且数值停止在100天不变



--  作者:有点蓝
--  发布时间:2019/8/15 9:53:00
--  
If e.DataCol.Name = "交货日期" Then
    If e.DataRow.IsNull("交货日期") Then
        e.DataRow("倒计时") = Nothing
    Else
dim d as integer = (Cdate(e.DataRow("交货日期")) - Date.Today).TotalDays
if d>100 then d = 100
        e.DataRow("倒计时") = d
    End If
End If