Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Combined GP Company Report

(0) ShareShare
ReportReport
Posted on by

I have a SQL Stored Procedure that generates data for one GP Company.  Is there a way to pass a database through as a parameter to return a combined report?  For example, how would I go about getting a combined AP Aging for three GP companies?

 Any samples would be greatly appreciated.

 

Thanks!

Ryan

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Re: Re: Combined GP Company Report

    Ryan, please see the link in my post above which discusses about how to capture the results returned from a stored procedure. The idea is to capture the result set for each company into a temp table and then combine these temp tables via a SQL UNION.

    I am cutting and pasting the sample script to save the results of a stored proc to a table:


    INSERT INTO SomeTableThatMatchesTheSproc (...)
    EXEC StoredProcedureName

    SELECT * FROM SomeTableThatMatchesTheSproc

  • Ryan D McBee Profile Picture
    Ryan D McBee on at
    Re: Re: Combined GP Company Report

    Thanks Victoria.  I have followed your blogs before.  This gets me what I need.

     If I am to get a historical aging, is there a way to execute a stored proc on each db and have results returned?

  • Victoria Yudin Profile Picture
    Victoria Yudin 22,766 on at
    Re: Combined GP Company Report

    Ryan,

    If you know the names of the databases and companies upfront and are ok with hardcoding them, this is pretty straightforward.  Here is an example of a multicompany view:

    http://victoriayudin.com/2008/11/10/sql-view-for-crystal-reports-to-show-open-ap-invoices-from-multiple-companies-in-gp/

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Combined GP Company Report

    You can try to select from a stored procedure into a temp table for each of the companies. After that, assuming you have created the temp tables COMPANY1..temp, COMPANY2..temp, you can do a UNION ALL:

    SELECT * FROM COMPANY1..temp

    UNION ALL

    SELECT * FROM COMPANY2..temp

    ....

     

     

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans