Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Help joining tables (no duplicates)

(0) ShareShare
ReportReport
Posted on by 3,015

I need help writing a SQL join that does not produce duplicates. I need to combine these three tables. Your help will be greatly appreciated seeing as I can use your example as a future reference of learning.

View: AccountTransactions

View: customers

View: ReceivablesTransactions

I am using report builder 2.0. GP 2010.

*This post is locked for comments

  • Verified answer
    Mahmoud Saadi Profile Picture
    32,738 on at
    RE: Help joining tables (no duplicates)

    Referring to Ms. Victoria's Blog, there is a script for all receivable transactions with associated definition for all the fields. Each transaction will have at least two of the following distribution types depending on the transaction type and associated parameters

    RM Distribution Types;

    • Cash
    • Terms Taken
    • Accounts Receivable
    • Writeoffs
    • Terms Available
    • GST
    • PPS
    • Other
    • Sales
    • Trade
    • Frieght
    • Miscellaneous
    • Taxes
    • COGS
    • Inventory
    • Finance Charges
    • Returns
    • Debit Memo
    • Credit Memo
    • Service
    • Warranty Expense
    • Warranty Sales
    • Commissions Expense
    • Commissions Payable
    • Unit Account
    • Rounding
    • Realized Gain
    • Realized Loss
    • Unrealized Gain
    • Unrealized Loss

    SQL view with all GL distributions for AR transactions

    I do believe that you need to get all Receivable transactions details for a specific distribution type (Account Receivable). To add a filter to the script above;

    SELECT * FROM 

    (

    SCRIPT

    ) AS RCVTRX

    WHERE RCVTRX.Distribution_Type = 'Accounts Receivable'

    Just to note that joining more than one distribution record for the receivable document will result with duplicating the header details as previously illustrated in another post of yours;

    Add debit and credit from RM10101

    Hope this helps, 

  • Suggested answer
    Richard Whaley Profile Picture
    25,195 on at
    RE: Help joining tables (no duplicates)

    What type of Account Transactions?  GL transactions?  and do you want to sort by customer or transaction?

    here is one script keying off of the customer:

    SELECT DISTINCT * FROM RM00101 C LEFT OUTER JOIN RM20101 T ON C.CUSTNUM=T.CUSTNUM

    If by account transactions you mean the GL transactions for the receivable, then do another Left Outer Join  on the RM distributions table, joining on the transaction IDs.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,760 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans