web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Sql join between transactions and GL posting

(0) ShareShare
ReportReport
Posted on by 4

Hi 

I'm creating a sales report. I join Generaljournalentry and generaljournal account entry, and it is giving me the revenue ok.

The problem is that i want to go a level deeper and get the detail for each transaction  like parts number and price of each of them. Can you help me figure out how to join generaljournalaccount entry with the transaction line.

thanks for your help :)

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    303,995 Super User 2026 Season 1 on at

    Hi Alzelus,

    What is the exact requirement of this report? Do you need accounting data? Or probably you can better start with the sales invoice details as base for the report?

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Please refer the below link that provides the relation between tables LedgerTrans and GeneralLedgerAccountEnty and let us know if anything is required.

    (Mapping the LedgerTrans Table to General Journal Tables)

    https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&cad=rja&uact=8&ved=0ahUKEwjik4Tq2IfYAhVCmuAKHcGdB_oQFghFMAQ&url=https%3A%2F%2Fdownload.microsoft.com%2Fdownload%2F4%2FE%2F3%2F4E36B655-568E-4D4A-B161-152B28BAAF30%2FMapping_the_LedgerTrans_table_to_General_Journal_tables_AX2012.pdf&usg=AOvVaw0cz6Lz27o9qVSLAHc4suN1

  • alzelus Profile Picture
    4 on at

    Not Working 

    Here is my query 

    SELECT
    DIRPARTYTABLE.NAME, 
    Address.COUNTY, 
    Address.STATE,
    address.CITY,
    address.ZIPCODE,
    CTSTABLE.SALESGROUP AS SALES_GROUP,
     GENACC.Postingtype, 
    PJ.DELIVERYNAME,
    PJ.PROJINVOICEID,
    PJ.ORDERACCOUNT,
    EX.EXCHANGERATE,
    GEN.JOURNALCATEGORY,
    GENACC.TRANSACTIONCURRENCYCODE,
    GENACC.TRANSACTIONCURRENCYAMOUNT AS PRICE,
    NULL AS COST ,
    GENACC.LEDGERACCOUNT,
    GEN.DOCUMENTNUMBER,
    GEN.ACCOUNTINGDATE,
    GEN.SUBLEDGERVOUCHERDATAAREAID,
    GEN.SUBLEDGERVOUCHER
     FROM GENERALJOURNALACCOUNTENTRY AS GENACC 
    INNER JOIN GENERALJOURNALENTRY AS GEN ON GEN.RECID=GENACC.GENERALJOURNALENTRY
    INNER JOIN EXCHANGERATE AS EX
    ON EX.VALIDFROM <= GEN.ACCOUNTINGDATE AND EX.VALIDTO>=GEN.ACCOUNTINGDATE
    INNER JOIN PROJINVOICEJOUR AS PJ ON PJ.LEDGERVOUCHER = GEN.SUBLEDGERVOUCHER
    INNER JOIN CUSTTABLE AS CTSTABLE
    ON CTSTABLE.ACCOUNTNUM = PJ.ORDERACCOUNT AND CTSTABLE.DATAAREAID='CEL'
     left outer join DIRPARTYTABLE ON DIRPARTYTABLE.RECID = CTSTABLE.PARTY  
     left outer join LOGISTICSLOCATION ON LOGISTICSLOCATION.RECID = DIRPARTYTABLE.PRIMARYADDRESSLOCATION  
     left outer join LOGISTICSPOSTALADDRESS AS Address ON Address.LOCATION = LOGISTICSLOCATION.RECID 
    AND Address.RECVERSION='1'
    
    WHERE  GEN.SUBLEDGERVOUCHERDATAAREAID='CEL'
    AND (GENACC.LEDGERACCOUNT LIKE '4%')
    AND (GENACC.LEDGERACCOUNT NOT LIKE '4400%')
    AND (GENACC.LEDGERACCOUNT NOT LIKE '4410%')
    AND GENACC.Postingtype !='52'


    I'm able to get the invoice number the customer informations but not able to get item lines hour lines or fee lines 

  • alzelus Profile Picture
    4 on at

    ex: to link the projinvoiceempl lines to the posting.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
Basit Profile Picture

Basit 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans