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 :
Small and medium business | Business Central, N...
Answered

Query Using Posted Purchase Invoice & Posted Purchase Credit Memo Tables

(2) ShareShare
ReportReport
Posted on by 68
Hi,
 
I want to create a query object in which data must be from Post.Pur.Inv Table & from Post.Pur.Crm Table,
 
Is it possible , if not then if i create two separate queries can i combine them in temp table ? 

please help me understand this concept
I have the same question (0)
  • Verified answer
    One_&_Only_Naveen Profile Picture
    68 on at
    Query Using Posted Purchase Invoice & Posted Purchase Credit Memo Tables
    Thank you all for your time and advice,
     
    as suggested, I created two queries and combined them into one in a Temporary table, and it solved my issue.
     
    Also when combining them on temp table i created a procedure in table definition itself  and called in my report at onPredataitem Trigger, is it correct and efficient way to deal? ( get_Pur_Combined_data is defined in my Temp Table object definition)
     trigger OnPreDataItem()
                begin
                    Get_Pur_Combined_Data(QryPur, QryPR, From_Date, To_Date);
                end;
  • Gerardo Rentería García Profile Picture
    22,524 Most Valuable Professional on at
    Query Using Posted Purchase Invoice & Posted Purchase Credit Memo Tables

    Hi, good day
    I hope this can help you, and give you some hints.

    Data Item Links - Business Central | Microsoft Learn

    Best Regards
    Gerardo

  • Suggested answer
    Khushbu Rajvi. Profile Picture
    18,797 Super User 2025 Season 2 on at
    Query Using Posted Purchase Invoice & Posted Purchase Credit Memo Tables

    It's not possible to directly combine Posted Purchase Invoices and Posted Purchase Credit Memos in a single query in Business Central, but you can create two separate queries and combine their data into a temporary table using AL code. 

  • Suggested answer
    Alexander Drogin Profile Picture
    262 on at
    Query Using Posted Purchase Invoice & Posted Purchase Credit Memo Tables
    This would a UNION statement in SQL, and unions are not supported in BC queries. So yes, you need to create two separate queries and process results separately or insert into a temporary table.

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 > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,899 Super User 2025 Season 2

#2
Sumit Singh Profile Picture

Sumit Singh 2,444

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,304

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans