我的代码:
Failed to find configured root that contains <path>
答案 0 :(得分:1)
由于语法错误,您会收到错误消息。 where子句过滤记录,因此通常在查询末尾使用它,例如
SELECT
rs.[Id] AS 'Id'
,bkngSrc.[SourceName] AS 'BkngSrc'
,payMode.[Description] AS 'PayMode'
,rs.[GuestName] AS 'GuestName'
,rs.[Addr] AS 'Addr'
,rs.[City] AS 'City'
,rs.[EntryDate] AS 'EntryDate'
FROM dbo.ResvReg rs
LEFT JOIN [dbo].[BkngSource] bkngSrc on rs.[BkngSrc] = bkngSrc.[Id]
LEFT JOIN [dbo].[PaymentMode] payMode on rs.[PayMode] = payMode.[Id]
WHERE EntryDate>= '11/08/2018'
如果要先过滤然后再加入,请使用编写嵌套查询。这样的事情可以解决问题
SELECT
t.[Id] AS 'Id'
,bkngSrc.[SourceName] AS 'BkngSrc'
,payMode.[Description] AS 'PayMode'
,t.[GuestName] AS 'GuestName'
,t.[Addr] AS 'Addr'
,t.[City] AS 'City'
,t.[EntryDate] AS 'EntryDate'
from
(
SELECT *
FROM dbo.ResvReg rs
WHERE EntryDate>= '11/08/2018'
) t
LEFT JOIN [dbo].[BkngSource] bkngSrc on t.[BkngSrc] = bkngSrc.[Id]
LEFT JOIN [dbo].[PaymentMode] payMode on t.[PayMode] = payMode.[Id]