cancel
Showing results for 
Search instead for 
Did you mean: 

Timestamp on approved sales order

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thank you everyone. ORDR has a field [updateTS] and it's what I was looking for.

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Thanks for feed back.

Can you explain how did you get approved time from this field?

What you mean by approved sales order?

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

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.

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Thanks for feedback. I thought your requirement  from system approval process.

Thanks & Regards,

Nagarajan


Former Member
0 Kudos

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

Answers (3)

Answers (3)

kothandaraman_nagarajan
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi,

You may check this:

The table name in the query can be changed to sales order table name easily.

Thanks,

Gordon

Former Member
0 Kudos

Hi

SELECT *  FROM OWDD T0

Thanks

Mohammad Imran