on 06-05-2009 4:04 PM
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,
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.