跳至主要內容

库存盘点报表

五六零网校小于 1 分钟

代码示例

SELECT T0.[DocNum], T0.[CountDate], T1.[ItemCode], T2.[FrgnName], T1.[ItemDesc]
	, T1.[Freeze], T1.[InvUoM], T1.[CountDate], T3.[BinCode], T1.[Counted]
	, T1.[Difference], T1.[InWhsQty]
FROM OINC T0
	INNER JOIN INC1 T1 ON T0.[DocEntry] = T1.[DocEntry]
	INNER JOIN OITM T2 ON T1.[ItemCode] = T2.[ItemCode]
	INNER JOIN OBIN T3 ON T1.[BinEntry] = T3.[AbsEntry]
	INNER JOIN OITB T4 ON T2.[ItmsGrpCod] = T4.[ItmsGrpCod]
WHERE (T0.[CountDate] = '[%0]'
		OR '[%0]' = '')
	AND (T0.[Status] = '[%1]'
		OR '[%1]' = '')
	AND (T4.[ItmsGrpNam] = '[%2]'
		OR '[%2]' = '')
	AND (T1.[ItemCode] = '[%3]'
		OR '[%3]' = '')
	AND (T0.[Taker1Id] = '[%4]'
		OR '[%4]' = '')
	AND (T0.[CountType] = '[%5]'
		OR '[%5]' = '')
	AND (T0.[DocNum] = '[%6]'
		OR '[%6]' = '')
	AND (T1.[WhsCode] = '[%7]'
		OR '[%7]' = '')