Skip to Content

Query to pull data from JDT1 table, join help

Experts,

I have a client who needs to have a query report similar to the view when drilling down into the account detail, but with added UDF's.

Here is my query, I believe that I have the joins wrong, but do not know where....

SELECT DISTINCT T0.[DocNum], T0.[CardName], T0.[DocDate], T0.[NumAtCard] AS 'PO ref', T1.[ItemCode], T1.[Quantity], T1.[LineTotal], T0.[U_NBS_GPA_08], T0.[U_NBS_GPA_09], T0.[U_NBS_GPA_10], T0.[U_NBS_GPA_11], T0.[U_NBS_GPA_04], T0.[U_NBS_GPA_05], T0.[U_NBS_GPA_01], T0.[U_NBS_GPA_02], T0.[U_NBS_GPA_03], T0.[ShipToCode], T4.[FormatCode]


FROM OINV T0 INNER JOIN INV1 T1 ON T0.[DocEntry] = T1.[DocEntry] INNER JOIN OJDT T2 ON T0.[TransId] = T2.[TransId] INNER JOIN JDT1 T3 ON T2.[TransId] = T3.[TransId] INNER JOIN OACT T4 ON T0.[CtlAccount] = T4.[AcctCode]


WHERE T4.[AcctName] =[%0]

Your help would be much appreciated.

Marli

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jul 29, 2016 at 03:43 AM

    Try:

    INNER JOIN OACT T4 ON T3.[Account] = T4.[AcctCode] instead of


    INNER JOIN OACT T4 ON T0.[CtlAccount] = T4.[AcctCode]

    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.