Skip to Content
0

PO Report Status report broken down by User/Creator of PO

May 15 at 10:13 AM

15

avatar image
Former Member

Hi experts,

Hope you can assist me. I am somewhat of a novice at creating SQL queries but have used the SQL Wizard to good effect in the past.

I have created the following SQL query which provides me with dates for the creation and closing of a PO. I want to add the name the name of the person responsible for generating the PO. However, I am getting error message - T0.UserSign could not be bound. Any ideas?

SELECT T0.[DocNum], T0.[DocDate] AS 'Doc. Date',T0.[DocStatus], T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Quantity], T2.[DocDate] AS 'Closed Date', T3.[U_NAME] FROM OPOR T0 INNER JOIN POR1 T1 ON T0.[DocEntry] = T1.[DocEntry], OPDN T2 INNER JOIN OUSR T3 ON T0.[UserSign] = T3.[USERID] WHERE T0.[DocDate] >= '[%1]' AND T0.[DocDate] <= '[%2]'

SQL
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Nagarajan K May 15 at 01:23 PM
0

Hi,

Try this query,

SELECT T0.[DocNum], T0.[DocDate] AS 'Doc. Date',T0.[DocStatus], T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Quantity], T2.[DocDate] AS 'Closed Date', T4.[U_NAME] as 'Created By', T5.[U_NAME] as 'Closed By'

FROM

OPOR T0 INNER JOIN POR1 T1 ON T0.[DocEntry] = T1.[DocEntry]

left join PDN1 T2 on T2.[BaseEntry] = T1.Docentry and T2.[BaseLine] = T1.[LineNum]

INNER JOIN OPDN T3 ON T2.[DocEntry] = T3.[DocEntry]

INNER JOIN OUSR T4 ON T0.[UserSign] = T4.[USERID]

INNER JOIN OUSR T5 ON T0.[UserSign] = T5.[USERID]

WHERE T0.[DocDate] >= '[%1]' AND T0.[DocDate] <= '[%2]'

Regards,

Nagarajan

Share
10 |10000 characters needed characters left characters exceeded