Document History – Quantity change log query
It is similar to Change log function and this function give list of changed field. To find required field like quantity, just copy and paste it in query generator and execute below query.
T2.DocNum,T2.[DocStatus], T2.[CardName],T2.[NumAtCard], T1.LineNum+1 as ‘Line’, ‘Qty’ as ‘Field’,
cast(T1.Quantity as varchar(18)) as ‘OldValue’, cast(T0.Quantity as varchar(18)) as ‘NewValue’, T2.UpdateDate, T4.[U_Name] as ‘UpdatedBy’, T2.[DocTime]
JOIN ADO1 T1 ON T2.docentry = T1.docentry AND T2.Objtype = T1.Objtype and T1.Loginstanc = T2.LogInstanc-1
JOIN ADO1 T0 ON T2.docentry = T0.docentry AND T2.Objtype = T0.Objtype AND T1.LineNum = T0.LineNum
INNER JOIN OUSR T4 ON T2.UserSign2 = T4.INTERNAL_K
AND T0.LogInstanc = T2.Loginstanc
T0.Quantity<>T1.Quantity AND T2.[CardCode] BETWEEN ‘AAA‘ AND ‘BBB‘ AND T2.[DocStatus] = ‘O’ AND DateDiff(d,T2.UpdateDate,GETDATE()) <= 0
Replace customer code AAA and BBB with your customer code.