以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]科目代码日期计算 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=102834) |
||||
-- 作者:yangsion -- 发布时间:2017/6/26 16:41:00 -- [求助]科目代码日期计算 请问一下如附件,科目代码怎么改可以算出工期, 开始日期为子项目最小日期 完成日期为子项目最大日期 Dim StartDate As Date = dt.Compute("Min(开始日期)", "开始日期 IS NOT NULL")
|
||||
-- 作者:有点色 -- 发布时间:2017/6/26 17:16:00 -- Dim kmdm As String = "1001" Dim dt As DataTable = DataTables("会计科目") Dim filter As String = "开始日期 IS NOT NULL and 科目代码 like \'" & kmdm & "%\'" Dim StartDate As Date = dt.Compute("Min(开始日期)", filter) Dim EndDate As Date = dt.Compute("Max(完成日期)", filter) msgbox(startdate & " " & Enddate) Dim sp As TimeSpan = Enddate - startdate msgbox(sp.TotalDays) |