跳至主要內容

按照物料名称查销售数量

五六零网校小于 1 分钟

示例代码

SELECT T1.[U_MaterialName], T1.[ItemCode], T1.[Dscription], SUM(T1.[Quantity]) AS '总计销售数量'
FROM ORDR T0
	INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry]
WHERE (T1.[U_MaterialName] LIKE '%%[%3]%%'
		OR '[%3]' = '')
	AND T0.[DocDate] >= [%1]
	AND T0.[DocDate] <= [%2]
GROUP BY T1.[U_MaterialName], T1.[ItemCode], T1.[Dscription]