Skip to Content
author's profile photo Former Member
Former Member

Change Log Query

Does anyone have a query to list all purchase orders changed (Closed would be great) by a particular user name?

Regards,

Fred

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Nov 09, 2012 at 03:59 PM

    You can start from this:

    Select b.DocNum,a.* From
    (SELECT T2.[U_NAME] , T0.[CardName], T0.[UpdateDate], T1.[DocNum]
    FROM ADOC T0 inner join OPOR T1 on T0.DocEntry=T1.DocEntry
    INNER JOIN OUSR T2 ON T0.UserSign2 = T2.USERID WHERE T0.[ObjType]=22
    Union all
    SELECT T2.[U_NAME] 'UpdatingUser', T0.[CardName], T0.[UpdateDate], T0.[DocNum]
    FROM OPOR T0
    INNER JOIN OUSR T2 ON T0.UserSign2 = T2.USERID ) A
    inner join OPOR B on A.DocNum=B.DocNum
    Where a.U_NAME='manager'
    Order By b.DocNum
    for browse

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 09, 2012 at 06:43 PM

    Hi Fred,

    Try:

    SELECT T2.[U_NAME] , T0.[CardName], MAX(T0.[UpdateDate]) 'Last Updated', T1.[DocNum]

    FROM ADOC T0 inner join OPOR T1 on T0.DocEntry=T1.DocEntry AND T1.DocStatus = 'C'

    INNER JOIN OUSR T2 ON T0.UserSign2 = T2.USERID

    WHERE T0.[ObjType]=22 AND T2.[U_NAME] LIKE '[%0]%'

    GROUP BY T2.[U_NAME] , T0.[CardName], T1.[DocNum]

    Thanks,

    Gordon

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.