似乎不喜欢SUM(c.[chargeable weight])
之后的第一个逗号。你们能找出原因吗?我真的无法理解为什么会这样做。
Select
(SUM(c.[Chargeable Weight]), MAX (ts.systemstamp), mm.MovementRef
FROM dbo.whsConsignment wc
INNER JOIN dbo.cgtConsignment c ON c.[Consignment Reference] = wc.ConsignmentReference
INNER JOIN dbo.tsAdditionalColInfo ts on ts.[ConsignmentReference]= wc.ConsignmentReference
inner join dbo.movConLink m on m.ConsignmentReference = c.[Consignment Reference]
inner join dbo.movMovement mm on mm.MovementID = m.MovementID
--AND wc.whsHeaderID = wh.WhsHeaderID
AND wc.StatusCode = 'NL'
AND c.[Service Type] = 'C'
--AND ts.SlackNoSlack like 'No Slack - Must Load%'
--and ts.SLackNoSLack like 'No Slack - Tripped%'
and ts.scheduledescription = 'No Slack - Tripped'
group by mm.MovementRef) as chargeableweight
--and ts.systemstamp = max (ts.systemstamp)
Into #2chargns
答案 0 :(得分:1)
您错过了括号内的match="Document"
SELECT