Skip to Content

AP Invoice BP Reference

Hi all

How to join this Query to AP Invoice OPCH and PCH1 to show AP Invoice BP Reference No? I tried this Query but no result.

SELECT T0.[TargetType], T0.[DocEntry], T1.[DocEntry], T0.[TrgetEntry], T1.[DocEntry], T1.[BaseRef], T2.[NumAtCard] FROM PDN1 T0 LEFT JOIN PCH1 T1 on T1.[BaseRef]=T0.[TrgetEntry] INNER JOIN OPCH T2 ON T1.[DocEntry] = T2.[DocEntry] WHERE T0.[DocEntry] =1

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 11, 2019 at 08:26 AM

    Hi Kedalene Chong

    can you please try this below query

    select PDN1.TargetType,

    PDn1.DocEntry,

    PCH1.DocEntry

    ,pdn1.TrgetEntry,

    pch1.DocEntry,pch1.BaseRef,OPCH.NumAtCard from OPDN inner join PDN1 on opdn.DocEntry=pdn1.DocEntry inner join pch1 on pdn1.BaseEntry=pch1.DocEntry inner join opch on pch1.DocEntry=opch.DocEntry

    Regards

    Brij

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 16, 2019 at 09:16 AM

    Hi Brij

    Thanks for your effort. I tested the result is same as my own initial Query, the same Item Code is duplicated 5 times.

    Please let me know if you able to correct the joins, thanks!

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 16, 2019 at 09:36 AM

    Hi Kedalene

    Why did you use the PDN1table?

    I think you can delete from query.

    Kind regards

    Agustín

    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.