SQL服务器08附近语法错误')'
尝试从Excelmacros插入到SQL数据库的以下值
我收到以下错误消息'不正确的语法附近'('。
代码是…
Dim insert2 As String insert2 = "INSERT INTO DETAIL" _ & " ( plant, taskno, commentno, commentby, commenton, comment, nextactionby) VALUES " _ & " ( 'UK' ((SELECT max(taskno) AS count from HEADER),'1', '" & UserID & "', CONVERT(datetime, '" & Hdate & "' ,103), '" & Dcomment & "', '" & Dnextactionby & "')"
任何人都可以解释为什么这是发生?
这里有一个缺失的逗号和一些不平衡的括号:
'UK' ((SELECT max(taskno) AS count from HEADER) ^ ^^ ^