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

Community site session details

Session Id :
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

I have the same question (0)
  • Community Member Profile Picture
    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
    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
    22,768 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
    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

Responsible AI policies

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

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
babubaskaran@outlook.com Profile Picture

babubaskaran@outloo... 2

#1
Yng Lih Profile Picture

Yng Lih 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans