以文本方式查看主题

-  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=77337)

--  作者:wldhj
--  发布时间:2015/11/16 20:18:00
--  [求助]字符转日期
如:20150416这样的字符怎样转成日期格式,能用DateGroupEnum
--  作者:大红袍
--  发布时间:2015/11/16 20:41:00
--  

不能用。转成日期列,才能用,增加一列日期列,写代码

 

For Each r As Row In Tables("表A").Rows
    Dim str As String = r("第一列")
    If str.Length = 8 Then
        r("第二列") = new Date(str.substring(0,4), str.substring(4,2), str.substring(6,2))
    End If
Next