采购申请报表
小于 1 分钟
代码示例
SELECT T0.[DocStatus], T0.[DocNum], T0.[DocDate], T1.[ItemCode], T1.[Dscription]
, T1.[Quantity], T1.[OpenQty], T1.[Quantity] - T1.[OpenQty] AS '已订货'
FROM OPRQ T0
INNER JOIN PRQ1 T1 ON T0.[DocEntry] = T1.[DocEntry]
WHERE T0.[CANCELED] = 'N'
AND T0.[DocDate] >= [%4]
AND T0.[DocDate] <= [%6]
AND (T1.[ItemCode] LIKE '%%[%1]%%'
OR '[%1]' = '')
ORDER BY T0.[DocNum]