小编Bro*_*ius的帖子

SQL 查询错误让我发疯!

我想知道是否有人可以在我的 SQL-Query 中找到我似乎找不到的错误.. 一直在同一行代码上运行大约 2 个小时,这让我发疯了!

所以,这是查询...(很长,但希望它是可读的...)我在 VBA 中工作,连接到数据库,因此 ComboBox 值和变量。

我得到的错误说

RfD_ 附近的语法不正确

所以,它来了。振作起来:

SQLString = 
"SELECT 
RfD_.RfD_ID
, RfD_.RfD_Version
, RfD_Status
, RfD_ProjectRef
, RfD_ProjectName
, RfD_StartDate
, RfD_FinishedDate, " & _

"RfD_ActivityName
, Deliverables_.Deliverables_ID
, Deliverables_.Deliverables_Deliverable
, Deliverables_.Deliverables_AcceptanceCriteria
, Deliverables_.Deliverables_Deadline
, Deliverables_.Deliverables_Delivered 
FROM [RFD_New].[dbo].[RfD_] " & _

"Inner join [RFD_New].[dbo].[Deliverables_] 
    on RfD_.RfD_ID = Deliverables_.RfD_ID" & _
    "And RfD_.RfD_Version = Deliverables_.RfD_Version 
where RfD_.RfD_StartDate >= '" & DateFrom & "' 
    and RfD_.RfD_FinishedDate <= '" & DateTo & "' " …
Run Code Online (Sandbox Code Playgroud)

sql-server

0
推荐指数
1
解决办法
127
查看次数

标签 统计

sql-server ×1