我试图在ProjectWise的Server数据库实例上运行ADODB查询,使用以下字符串定义的查询:
select
dms_audt.o_acttime as actionTime,
dms_stat.o_statename as state,
dms_doc.o_filename as filename,
dms_doc.o_projectno as project
from dms_audt
inner join
dms_stat
on dms_audt.o_numparam2=dms_stat.o_stateno
inner join dms_doc on dms_audt.objguid=dms_doc.o_docguid
where substring(dms_doc.o_filename,1,4)="abcd")
and charindex(dms_doc.o_filename,"efgh")=0VBA给出的运行时错误为:
Incorrect syntax near ')'这使我认为我不是在错误地使用substring(),就是使用了charindex()。无论是将、abcd、和efgh字符串包装为单引号还是双引号,我都收到了此错误。你知道我在这里做错什么了吗?
发布于 2013-10-04 18:04:56
你有一个额外的支架。
这> where substring(dms_doc.o_filename,1,4)="abcd") and charindex(dms_doc.o_filename,"efgh")=0
需要:
where substring(dms_doc.o_filename,1,4)='abcd' and charindex(dms_doc.o_filename,'efgh')=0
https://stackoverflow.com/questions/19187881
复制相似问题