on 04-28-2014 6:10 PM
Hello all,
We want to track when the sales orders are approved. Is there a query that can give me the time that it was approved/confirmed?
Thank you everyone. ORDR has a field [updateTS] and it's what I was looking for.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nagarajan,
Sure. Let me first explain how we process our sales orders. One employee (forklift driver) enters new and add sales orders. Another employee checks to make sure that all the data in the sales orders are correct (Quality control team). When all info are correct, the QC team manually approves/confirms (updates) the sales orders. Below is the query:
SELECT T0.DocNum, T0.CreateDate, T0.CreateTS, T0.UpdateDate, T0.UpDateTS, T0.Confirmed, T1.U_NAME
FROM ORDER T0
INNER JOIN OUSR T1 ON T0.UserSign2 = T1.USERID
The result tells me the date and time the sales order was created and the date and time it was approved/confirmed and the person who confirmed it.
Hi Jennifer,
Just so that you're aware, that'll only actually work if other amendments aren't carried out on the sales order.
The fields you're using are updated regardless of the change made to the order, therefore if the order is approved on the Monday, but another field (say DelDate) is updated on the Thursday, when your query is run on the Friday, it'll suggest that the order was updated on Thursday.
You could build in the below query (maybe as a sub-query) to enable you to establish the date at which the confirmed flag was set to "Y" which may be a little more robust......
SELECT TOP 1 T0.UpdateDate FROM ADOC T0
WHERE T0.ObjType = '17' AND T0.Confirmed = 'Y'
Hopefully this won't impact you given the business process you have in place, but thought it best to highlight.
Cheers,
Julian
Hi,
Try this query:
SELECT t0.docnum, T3.[U_NAME],T2.[UpdateDate], T2.[UpdateTime] FROM ORDR T0 inner join OWDD T1 on t0.docentry = t1.docentry inner join WDD1 T2 on T1.[WddCode] = T2.[WddCode] INNER JOIN OUSR T3 ON T2.UserID = T3.USERID WHERE T2.[Status] = 'y' and T1.[ObjType] = 17
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
SELECT * FROM OWDD T0
Thanks
Mohammad Imran
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.