无法绑定多部分标识符“tblTask.Id”。 我错了什么?
SELECT SUM(CAST(Value as int)) FROM [tblExtraFieldData]
WHERE [tblExtraFieldData].[FieldId] = '10010'
AND [tblExtraFieldData].[OwnerId]=[tblTask].[Id]
AND [tblTask].[Status]=4
AND [tblTask].[CustomA3]='Bygg'
答案 0 :(得分:0)
试试这个
SELECT SUM(CAST(Value as int)) FROM [tblExtraFieldData] tble
INNER JOIN tblTask tblt ON tble.[OwnerId]=tblt.[Id]
WHERE tble.[FieldId] = '10010'
AND tble.[Status]=4
AND tble.[CustomA3]='Bygg'
OR
SELECT SUM(CAST(Value as int)) FROM [tblExtraFieldData],[tblTask]
WHERE [tblExtraFieldData].[FieldId] = '10010'
AND [tblExtraFieldData].[OwnerId]=[tblTask].[Id]
AND [tblTask].[Status]=4
AND [tblTask].[CustomA3]='Bygg'
可能使用第一个。