答案 0 :(得分:0)
删除(在
之后) .....FROM ";
sSQL += "[ComponentText] .....
而不是
sSQL += "([ComponentText] ...
答案 1 :(得分:0)
这是有效的sSQL:
SELECT Q. [ComponentCounter] FROM(SELECT [ComponentText]。[ComponentCounter],[ComponentText]。[TextId],[ComponentText]。[Text] FROM [ComponentText] WHERE [ComponentText]。[TextId] = @bomgroupid AND [ComponentText]。[Text] = @bomdevice)AS Q INNER JOIN [连接]为P ON Q. [ComponentCounter] = P. [CompCounter] WHERE Q. [ComponentCounter] IN(SELECT [ComponentText]。[ComponentCounter] FROM [ComponentText] WHERE [ComponentText]。[TextId] = 160040 AND [ComponentText]。[Text] = @type);
我不习惯使用别名,但它确实帮助我自己和MS Access简化了这个SQL语句。我必须记住这一点。谢谢大家的帮助。