|
两步骤
1.按ALT+F11,进入VBA编辑,菜单 插入\模块
复制下段代码到右边空白处
Function GetString(T As String, I As Integer) As String
GetString = Split(T, "-")(I - 1)
End Function
2、再按ALT+F11回到 ACCESS 新建一个查询,切换到SQL模式,所下段SQL粘贴进去,保存,执行一次就行了
记住,只能执行一次
INSERT INTO tblPO_Temp ( PO, PO_LINE, QTY, CUSTPN, CURE_DATE )
SELECT getstring(a.t,1) , getstring([a].[t],2) , getstring([a].[t],3), getstring([a].[t],4) , cdate("01/" & getstring([a].[t],5))
FROM (SELECT tbltemp_PARKER.Parker_barcode AS T
FROM tbltemp_PARKER) AS a; |
|