我需要在以下查询中添加od.DocDate以过滤我的水晶报表中的数据。
SELECT
sp.SlpCode,
sp.SlpName,
sp.Telephone,
od.DocDate,
COUNT(od.DocEntry) count,
COUNT(CASE WHEN od.U_ArtWork = 'NotRec' THEN 1 END) AS Artwork,
COUNT(CASE WHEN od.U_DetailPending = 'No' THEN 1 END) AS DetailPrinting
FROM OSLP sp
LEFT JOIN ORDR od
ON SP.SlpCode = od.SlpCode
GROUP BY
sp.SlpCode,
sp.SlpName,
od.DocDate,
sp.Telephone
ORDER BY
sp.SlpName;