Hi Experts
I have an issue with a query which shows me the remaining value of my open sales orders (basically replicating the open items list but with the document owner added to the query).
It seems to be working fine except for when the document owner has not been added to the document. Then the document does not appear in the query results.
Can someone please tell me how to refine the query code so that it shows both the First Name, Last Name and when there is no name in the fields from the OHEM table?
SELECT T0.[DocNum], T0.[CardCode], MAX(T0.[CardName]) as 'Customer Name', T0.[DocDate], T0.[DocDueDate], T0.[U_DefCC], SUM(T1.[OpenQty] *T1.[Price]) as 'Remaining Vaue', T2.[firstName], T2.[lastName] FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OHEM T2 ON T0.OwnerCode = T2.empID WHERE T1.[OpenQty] != 0 GROUP BY T0.[DocNum], T0.[DocDate], T0.[DocDueDate], T0.[U_DefCC], T0.[CardCode], T2.[firstName], T2.[lastName]
Regards
Jon