以文本方式查看主题

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

--  作者:cqlistone
--  发布时间:2016/1/15 11:51:00
--  日期计算
目的 

表A有四列,日期1、列2整数型、日期2、列3字符型

1.       根据日期1求得天数再加上列2的值得到新的日期并赋值到 日期2

2.       求得日期2的日期如果是周六、周日和国家法定日期,则相应顺延。即新的日期2不是周六、周日和国家法定节假日日期

表B有 列1

1.       如果表A日期2的值是今天的日期,表B则增加一行,并把表A列3的值赋值到表B的列1

2.       表A赋值到表B后,表A列3 对应行 日期1等于今天的日期

请帮忙修改下代码

 

if tables("表A").isnull("日期1")=false

   dim d as date =tables("表A").current("日期1")

   dim r as integer=tables("表A").current("列02")

   dim d1 as date = d.adddays(r)

   Dim w As Integer = d1.DayOfWeek

  

   tables("表A").current("日期2")= d3

   if d3= date.today

      tables("表 B").addnew

      tables("表 B").current("列1")=tables("表A").current(“列3”)

      tables("表A").current("日期1")=date.today

   end if

end if


--  作者:Hyphen
--  发布时间:2016/1/15 12:09:00
--  
Dim w As Integer = d1.DayOfWeek
if w=6 then 
日期加2天
elseif w=7
日期加1天
end if

法定假日需要用一个表自己存储起来,然后查表判断,方法同上