跳至主要內容

警告:采购退货单正负10天内提醒

五六零网校小于 1 分钟

  • 示例代码
SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T1.[ItemCode]
	, T1.[Dscription], T4.[SlpName] AS 采购员, T1.[UseBaseUn], T1.[Quantity], T1.[Price]
	, T1.[VatPrcnt], T1.[DiscPrcnt], T1.[LineTotal], T0.[DocDate], T0.[DocStatus]
	, T0.[Comments], T1.[WhsCode], T1.[OpenQty], T2.[OnHand]
FROM ORPD T0
	INNER JOIN RPD1 T1 ON T0.[DocEntry] = T1.[DocEntry]
	INNER JOIN OITM T2 ON T1.[ItemCode] = T2.[ItemCode]
	INNER JOIN OITB T3 ON T2.[ItmsGrpCod] = T3.[ItmsGrpCod]
	INNER JOIN OSLP T4 ON T0.[SlpCode] = T4.[SlpCode]
WHERE 
datediff(d, T0.[DocDate], GetDate()) >-10 AND   datediff(d, T0.[DocDate], GetDate()) <10