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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

SQL query for Journal Entries.

(0) ShareShare
ReportReport
Posted on by

Hi

I would like to know if somebody can help me with the tables that I have to use in order to do a query showing who did the JE and who approve it and when?

Thanks

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    You can use the following query to get the data like createdBy, approvedby, createddatetime on the JE. Please let me know if anything is missing.

    select
    ledgerJournalTable.APPROVER,
    generalJournalEntry.SUBLEDGERVOUCHER,
    journalAccountEntry.POSTINGTYPE,
    ledgerJournalTable.CREATEDBY,
    ledgerJournalTable.CREATEDDATETIME
    from GeneralJournalAccountEntry as journalAccountEntry 
    inner join generalJournalEntry
    on ((generalJournalEntry.RecId = journalAccountEntry.GeneralJournalEntry)
    and (generalJournalEntry.SubledgerVoucherDataAreaId = 'XYZ')) -- specify companyId
    inner join subledgerVoucherGeneralJournalEntry
    on (subledgerVoucherGeneralJournalEntry.GeneralJournalEntry = generalJournalEntry.RecId)
    inner join ledgerJournalTrans
    on  ledgerJournalTrans.Voucher = subledgerVoucherGeneralJournalEntry.Voucher
    inner join ledgerJournalTable
    on  ledgerJournalTable.JournalNum = ledgerJournalTrans.JournalNum


  • Community Member Profile Picture
    on at

    Thank you Chaitanya

    But when I run that query I got a 0 on the Approver field.

    I need a query to run a report similar to the Ledger transaction Report-Audit.

    But looks like the approver is not in the ledgerJournalTable .

    Thanks

  • Community Member Profile Picture
    on at

    Thank you Sukrut

    But when I run that query I got a 0 on the Approver field.

    I need a query to run a report similar to the Ledger transaction Report-Audit.

    But looks like the approver is not in the ledgerJournalTable .

    Thanks

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

    Hi,

    Please use the below query.

    select
    dirPartyTable.NAME as [Approver],
    generalJournalEntry.SUBLEDGERVOUCHER,
    journalAccountEntry.POSTINGTYPE,
    ledgerJournalTable.CREATEDBY,
    ledgerJournalTable.CREATEDDATETIME
    from GeneralJournalAccountEntry as journalAccountEntry
    inner join generalJournalEntry
    on ((generalJournalEntry.RecId = journalAccountEntry.GeneralJournalEntry)
    and (generalJournalEntry.SubledgerVoucherDataAreaId = '3B10')) -- specify companyId
    inner join subledgerVoucherGeneralJournalEntry
    on (subledgerVoucherGeneralJournalEntry.GeneralJournalEntry = generalJournalEntry.RecId)
    inner join ledgerJournalTrans
    on  ledgerJournalTrans.Voucher = subledgerVoucherGeneralJournalEntry.Voucher
    inner join ledgerJournalTable
    on  ledgerJournalTable.JournalNum = ledgerJournalTrans.JournalNum
    inner join hcmworker
    on ledgerJournalTable.Approver = hcmWorker.RecId 
    inner join dirPartyTable
    on hcmWorker.Person = dirPartyTable.RecId
  • Suggested answer
    Amir Nazim Profile Picture
    5,994 on at

    details example and good explanation is here

    instructorbrandon.com/sql-for-general-ledger-data-by-dimension-for-building-non-ax-reports-with-ax-data-part-3-final

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans