以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  foxtable中如何计算两个日期列间相差的月数?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=8650)

--  作者:jxkqf
--  发布时间:2010/11/21 19:30:00
--  foxtable中如何计算两个日期列间相差的月数?
foxtable中如何计算两个日期列间相差的月数?
--  作者:老有所乐
--  发布时间:2010/11/21 20:27:00
--  

这一看行不行,如:

If e.DataRow.isnull("时间1") And  e.DataRow.isnull("时间2") Then
   e.DataRow("月数")=Nothing
 Else
   Dim d1 As Date =  e.DataRow("时间1")
   Dim d2 As Date = e.DataRow("时间2")
  e.DataRow("月数")=(d2-d1).days/30  

 End If


--  作者:mr725
--  发布时间:2010/11/21 21:41:00
--  
http://www.foxtable.com/dispbbs.asp?boardid=2&Id=8642 看3楼C版的最简单。