cancel
Showing results for 
Search instead for 
Did you mean: 

How do I know if a sales order change?

Former Member
0 Kudos

Hello experts,

Iu2019m making a query, in which I want to know if the u201CDelivery Dateu201D of a sales order has been changed, I try this one:

SELECT T0.[DocNum], T1.[DocNum], max(t1.[loginstanc]) FROM ORDR T0 inner join ADOC T1 on T0.[DocNum]= T1.[DocNum] GROUP BY T0.[DocNum], T1.[DocNum] having max(t1.[loginstanc]) >1 ORDER BY 1

But I canu2019t find a way of joining the information in the u201CDifferenceu201D window of the u201CChange logu2026u201D with my query, so I get all the sales order that change not only the once I need.

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try this one:

SELECT T0.DocNum, T1.DocNum, T0.DocDueDate, T1.DocDueDate, max(t1.loginstanc) Instant FROM dbo.ORDR T0

inner join dbo.ADOC T1 on T0.DocNum= T1.DocNum

WHERE T0.DocNum like '[%0\]%' AND T0.DocDueDate != T1.DocDueDate

GROUP BY T0.DocNum, T1.DocNum, T0.DocDueDate, T1.DocDueDate having max(t1.loginstanc) >1 ORDER BY 1

Thanks,

Gordon

Former Member
0 Kudos

Thanks Gordon!

Answers (0)