以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  从日期中提取月份到新的列  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=130265)

--  作者:992915529
--  发布时间:2019/1/17 10:57:00
--  从日期中提取月份到新的列
您好,我大表上的时期在增加行的时候自动添加,我想从日期中提取月份到另一个叫月份的列中
--  作者:有点甜
--  发布时间:2019/1/17 10:59:00
--  

方法一,添加表达式列

 

http://www.foxtable.com/webhelp/scr/1285.htm

 

方法二,编写datacolchanged事件代码

 

If e.datacol.name = "日期" Then

    If e.newvalue = nothing Then

        e.datarow("月份") = nothing

    Else

        e.datarow("月份") = e.newvalue.month

    End If

End If