以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  为什么计算结果数字都一样  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=125290)

--  作者:nbsugu_z
--  发布时间:2018/9/25 16:03:00
--  为什么计算结果数字都一样

Select Case e.DataCol.name
     Case "付息日","付息情况"
        If e.DataRow.IsNull("付息日") OrElse e.DataRow("付息情况")="已付" Then
            e.DataRow("距付息天数") = Nothing
        Else
           Dim t As TimeSpan
          Dim d As Date = CurrentTable.Current("付息日")
            t = Date.Today - d

          e.DataRow("距付息天数") =t.TotalDays
   End If
    End Select

 

执行后距付息天数列为什么是同一个数字?比如都是644天?


--  作者:有点甜
--  发布时间:2018/9/25 16:07:00
--  

Dim d As Date = CurrentTable.Current("付息日")

 

改成

 

Dim d As Date = e.DataRow("付息日")