各位老师好,我发了一个问题:
日期列改成字符串出错:
【回访时间 】是日期列 ,【拨打时间S】 是字符列,想实现如:把 2014-03-26 14:08 转换成 201403261408
If e.DataCol.name = "回访时间" Then
If e.DataRow.IsNull("回访时间") = False Then
e.DataRow("拨打时间S") = CStr(e.DataRow("回访时间")).Substring(0,4) & CStr(e.DataRow("回访时间")).Substring(5,2) & CStr(e.DataRow("回访时间")).Substring(8,2) & CStr(e.DataRow("回访时间")).Substring(11,2) & CStr(e.DataRow("回访时间")).Substring(14,2)
End If
End If
这段代码可以实现,但是当时间为下面这种情况时出错:
2014-03-26 08:40 就变成了这样: 201403268:0:
只要时间是10点前的都会这样。。。。08 的 0 没有计算进去。。。