跳至主要內容

生产订单报表

五六零网校小于 1 分钟

代码示例

SELECT T0.[DocNum]
	, CASE 
		WHEN T0.[Status] = 'P' THEN '已计划'
		WHEN T0.[Status] = 'R' THEN '已下达'
		WHEN T0.[Status] = 'L' THEN '已结算'
		WHEN T0.[Status] = 'C' THEN '已取消'
	END AS '单据状态', T0.[ItemCode], T1.[ItemName], T1.[FrgnName], T0.[PostDate] AS '下单日期'
	, T0.[StartDate], T0.[DueDate], T0.[PlannedQty], T0.[CmpltQty]
FROM OWOR T0
	INNER JOIN OITM T1 ON T1.itemcode = t0.itemcode
WHERE (T0.[ItemCode] LIKE '%%[%1]%%'
		OR '[%1]' = '')
	AND (T1.[ItemName] LIKE '%%[%2]%%'
		OR '[%2]' = '')
	AND (T1.[FrgnName] LIKE '%%[%3]%%'
		OR '[%3]' = '')
	AND (T0.[Status] LIKE '%%[%4]%%'
		OR '[%4]' = '')