0
我在下面的例子中努力做出不同的工作。我下面的結構之後:NOT,THU正確使用不同
請參閱下面的代碼:
DECLARE @StartDate DATETIME;
SET @StartDate = '20160727';
DECLARE @EndDate DATETIME;
SET @EndDate = '20160727 23:59:59';
SELECT ISNULL(
STUFF(
(SELECT ',' + (Coalesce (Distinct((wh.LocalDepotCode, 'Code not found'))
FROM cgtconsignment c
INNER JOIN dbo.whsConsignment wc ON wc.ConsignmentReference = c.[Consignment Reference]
INNER JOIN dbo.whsHeader wh ON wh.WhsHeaderID =wc.whsHeaderID INNER JOIN movmovement m ON m.MovementID = wh.RunMovID
WHERE m.MovementRef = 'NT-CZ-006824' AND wh.ArrDepDate BETWEEN @StartDate AND @EndDate
FOR XML PATH('')
),
1,1,''
)
,'') AS [Co-loads]
這就是我得到的,如果我運行查詢:星期四,星期四,星期四,星期四,星期四,星期五,THU ,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU,THU ,星期四,星期四,星期四,星期四,星期四,星期四,星期四,星期四,星期四,星期四,星期四,星期四,星期四,星期四,星期四,星期四,星期四,星期四,星期四,星期四,星期五,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不,不
我窩喜歡獲得以下內容:不,THU
任何想法?
這現在已經解決了(很好的舊試錯法)。那麼我應該刪除問題還是留在這裏? –
@LukStorms獨特的工作到最後,但爲了鍛鍊,我會嘗試給集團!感謝您的建議! –
將解決方案作爲答案發布並接受它(您將需要等待48小時,我想)或刪除問題。 –