Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

How to join POP30310 and POP10100 tables to GL10000, GL20000 , GL30000 and GL10001 tables in Dynamics GP 10

(0) ShareShare
ReportReport
Posted on by 85

Shown below are the SQL FROM statements from a VIEW I have created to show all transactions. I need to add the PO Number and Requisition number associated with the transactions.

Can someone show me the appropriate JOIN ON statements to connect to POP30310 to get the PONUMBER field and to POP10100 to get the CONFIRM1 field?

I have been able to link the tables but am getting duplicate records. I am not providing the appropriate JOIN statements and don't know which fields should be used for the JOIN. If someone could show me the appropriate JOIN statements I would be very grateful. If there is any documents showing which fields should be used to join various tables I would also be very greatful.

Thanks,

Lee

---------------------------------------------------------------------------- SQL statements follow ---------------------------------------

 

SELECT ....

FROM                      GL10001 AS [Unposted Trans] ( NOLOCK ) 

        INNER JOIN GL10000   AS [GL Work]             ( NOLOCK ) ON [GL Work].jrnentry                  = [Unposted Trans].jrnentry       

         INNER JOIN GL00105  AS IndexMSTR          ( NOLOCK ) ON [Unposted Trans].ACTINDX   = IndexMSTR.ACTINDX        

        INNER JOIN GL00100   AS AccountMSTR      ( NOLOCK ) ON IndexMSTR.ACTINDX           = AccountMSTR.ACTINDX      

        INNER JOIN GL00102   AS CategoryMSTR    ( NOLOCK ) ON AccountMSTR.ACCATNUM   = CategoryMSTR.ACCATNUM

 

UNION

 

SELECT ....

FROM                  GL20000 AS [Open Trans]        ( NOLOCK )    

       INNER JOIN GL00105 AS IndexMSTR          ( NOLOCK )  ON [Open Trans].ACTINDX        = IndexMSTR.ACTINDX       

       INNER JOIN GL00100 AS AccountMSTR      ( NOLOCK )  ON IndexMSTR.ACTINDX          = AccountMSTR.ACTINDX      

       INNER JOIN GL00102 AS CategoryMSTR    ( NOLOCK )  ON AccountMSTR.ACCATNUM = CategoryMSTR.ACCATNUM

        

UNION

 

SELECT ....

FROM                  GL30000 AS [History Trans]    ( NOLOCK )      

       INNER JOIN GL00105 AS IndexMSTR        ( NOLOCK ) ON [History Trans].ACTINDX         = IndexMSTR.ACTINDX       

       INNER JOIN GL00100 AS AccountMSTR    ( NOLOCK ) ON IndexMSTR.ACTINDX             = AccountMSTR.ACTINDX     

       INNER JOIN GL00102 AS CategoryMSTR   ( NOLOCK ) ON AccountMSTR.ACCATNUM    = CategoryMSTR.ACCATNUM

 

*This post is locked for comments

  • Suggested answer
    soma Profile Picture
    24,410 on at
    RE: How to join POP30310 and POP10100 tables to GL10000, GL20000 , GL30000 and GL10001 tables in Dynamics GP 10

    lbright,

    The GL10000 table contains the header details about the GL transactions and the table GL 10001 contains the work detail line records like jrnentry,dscriptn,creditamt,debitamt and etc.,

    Once a transaction is posted, the GL open transactions details will be created in GL20000 table.

    The number of records created in the table GL20000 is equal to the detail line records available from the table GL10001.

    If you post a transaction with 10 distributions, then 10 open transactions will be crated in GL20000 table.

    So, the GL10001.dscriptn field values will be stored in both GL20000 and GL30000 table.

  • Verified answer
    Mariano Gomez Profile Picture
    26,225 on at
    RE: How to join POP30310 and POP10100 tables to GL10000, GL20000 , GL30000 and GL10001 tables in Dynamics GP 10

    You got your terminology all mixed up. Unposted GL transactions (journal entries) remain in the GL10000 (Transaction Header) and GL10001 (transaction detail) until, well, they are posted. Once a GL journal is posted, header and detail records are left joined to produce a single entry per distribution account into the GL20000 table. The GL20000 table contains journals for all open year(s). When the year-end procedure is performed and the year is closed in GP, the records in GL20000 move to the GL30000 table (history) for the year that was closed.

    The Description column is common to GL10001, GL20000, and GL30000. So when you post a journal or close a fiscal year, the value follows through.

  • lbright Profile Picture
    85 on at
    RE: How to join POP30310 and POP10100 tables to GL10000, GL20000 , GL30000 and GL10001 tables in Dynamics GP 10

    Mariano,

    Your SQL helped a lot!! However, I also need to selected based on a value in  the GL10001.dscriptn field. Once a transaction is posted, where does the gl10001.dscriptn field get stored in GL10000,GL20000 and GL30000?

  • Verified answer
    Mariano Gomez Profile Picture
    26,225 on at
    RE: How to join POP30310 and POP10100 tables to GL10000, GL20000 , GL30000 and GL10001 tables in Dynamics GP 10

    with poRct as (

    select rctLine.POPRCTNM, rctLine.PONUMBER, rctLine.ITEMNMBR, rctLine.ITEMDESC, rctLine.UNITCOST, rctLine.EXTDCOST, rctLine.UOFM, poHdr.VENDORID, poHdr.CONFIRM1  from (

    select POPRCTNM, PONUMBER, ITEMNMBR, ITEMDESC, UNITCOST, EXTDCOST, UOFM  from POP30310

    union all

    select POPRCTNM, PONUMBER, ITEMNMBR, ITEMDESC, UNITCOST, EXTDCOST, UOFM  from POP10310

    ) rctLine left outer join (

    SELECT PONUMBER, VENDORID, CONFIRM1 FROM POP30100

    UNION ALL

    SELECT PONUMBER, VENDORID, CONFIRM1 FROM POP10100

    ) poHdr on (rctLine.PONUMBER = poHdr.PONUMBER)

    ),

    glTrx as (

    select 'Work' as Source, a.JRNENTRY, b.TRXDATE, a.ACTINDX, a.DEBITAMT, a.CRDTAMNT, a.ORMSTRID, a.ORDOCNUM from GL10001 a

    LEFT OUTER JOIN GL10000 b ON (a.JRNENTRY = b.JRNENTRY)

    UNION ALL

    select 'Open' as Source, JRNENTRY, TRXDATE, ACTINDX, DEBITAMT, CRDTAMNT, ORMSTRID, ORDOCNUM  FROM GL20000

    UNION ALL

    select 'Hist' as Source, JRNENTRY, TRXDATE, ACTINDX, DEBITAMT, CRDTAMNT, ORMSTRID, ORDOCNUM  FROM GL30000

    )

    SELECT gl.Source, gl.JRNENTRY, gl.TRXDATE, a.ACTNUMST, b.ACTDESCR, c.ACCATDSC, gl.DEBITAMT, gl.CRDTAMNT, gl.ORMSTRID, gl.ORDOCNUM, po.CONFIRM1

    FROM glTrx gl

    LEFT OUTER JOIN poRct po ON (gl.ORMSTRID = po.VENDORID) AND (gl.ORDOCNUM = po.POPRCTNM)

    LEFT OUTER JOIN GL00105 a ON (gl.ACTINDX = a.ACTINDX)

    LEFT OUTER JOIN GL00100 b ON (gl.ACTINDX = b.ACTINDX)

    LEFT OUTER JOIN GL00102 c ON (b.ACCATNUM = c.ACCATNUM)

    You may also want to consider restricting your GL info to the purchasing series only.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Almas Mahfooz Profile Picture

Almas Mahfooz 3 User Group Leader

Featured topics

Product updates

Dynamics 365 release plans