跳至主要內容

库存转储请求报表

五六零网校小于 1 分钟

代码示例

SELECT T0.[DocNum], T0.[taxDate], T1.[ItemCode], T1.[Dscription], T2.[FrgnName]
	, T4.[SlpName], T1.[Quantity], T1.[OpenQty], T2.[OnHand], T1.[FromWhsCod] AS 从仓库
	, T1.[WhsCode] AS 到仓库
FROM OWTQ T0
	INNER JOIN WTQ1 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 (T1.[ItemCode] >= '[%0]'
		OR '[%0]' = '')
	AND (T1.[ItemCode] <= '[%1]'
		OR '[%1]' = '')
	AND (T2.[FrgnName] >= '[%2]'
		OR '[%2]' = '')
	AND (T2.[FrgnName] <= '[%3]'
		OR '[%3]' = '')
	AND (T0.[taxDate] >= '[%4]'
		OR '[%4]' = '')
	AND (T0.[taxDate] <= '[%5]'
		OR '[%5]' = '')
	AND (T0.[DocStatus] = '[%6]'
		OR '[%6]' = '')
	AND (T3.[ItmsGrpNam] >= '[%7]'
		OR '[%7]' = '')
	AND (T3.[ItmsGrpNam] <= '[%8]'
		OR '[%8]' = '')
	AND (T0.[CARDCODE] >= '[%9]'
		OR '[%9]' = '')
	AND (T0.[CARDCODE] <= '[%10]'
		OR '[%10]' = '')
	AND (T0.[Cardname] >= '[%11]'
		OR '[%11]' = '')
	AND (T0.[Cardname] <= '[%12]'
		OR '[%12]' = '')
	AND (T0.[DOCNUM] >= [%17]
		OR [%17] = '')
	AND (T0.[DOCNUM] <= [%18]
		OR [%18] = '')
	AND (T1.[FromWhsCod] >= '[%13]'
		OR '[%13]' = '')
	AND (T1.[FromWhsCod] <= '[%14]'
		OR '[%14]' = '')
	AND (T1.[WhsCode] >= '[%15]'
		OR '[%15]' = '')
	AND (T1.[WhsCode] <= '[%16]'
		OR '[%16]' = '')
	AND (T4.[slpname] >= '[%19]'
		OR '[%19]' = '')
	AND (T4.[slpname] <= '[%20]'
		OR '[%20]' = '')
ORDER BY T0.[DocNum] DESC