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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

to get data from 2 qbds queries in report

(1) ShareShare
ReportReport
Posted on by 1,836
I have 2 qbds queries in report i need to the transaction both queries , how can i get the data in report and merge them together 
 please anyone guide me on this , below are my two queries .
 i want to fetch data  from both queries .
 
I have the same question (0)
  • Dineshkarlekar Profile Picture
    1,836 on at
    SELECT  VendPackingSlipTrans.PackingSlipId, PurchLine.PurchId, PurchLine.ItemId, PurchLine.InventTransId,
    VendPackingSlipTrans.Ordered, VendPackingSlipTrans.Qty FROM PurchLine 
    JOIN VendPackingSlipTrans ON PurchLine.InventTransId = VendPackingSlipTrans.InventTransId
    AND ((VendPackingSlipTrans.DeliveryDate>={ts '2024-02-01 00:00:00.000'}
    AND VendPackingSlipTrans.DeliveryDate<={ts '2024-02-29 00:00:00.000'})) 
    WHERE  PurchLine.DATAAREAID = 'SA01'
    GROUP BY VendPackingSlipTrans.PackingSlipId, PurchLine.PurchId, PurchLine.ItemId, PurchLine.InventTransId, 
    VendPackingSlipTrans.Ordered, VendPackingSlipTrans.Qty
    
    
    
    SELECT PurchLine.PurchId, PurchLine.ItemId, PurchLine.InventTransId,SUM(VendInvoiceTrans.Qty), 
    SUM(VendInvoiceTrans.LineAmount), SUM(VendInvoiceTrans.LineAmountTax)
      FROM PurchLine 
    JOIN  VendInvoiceInfoLine ON PurchLine.PurchId = VendInvoiceInfoLine.OrigPurchId
    JOIN  VendInvoiceJour ON VendInvoiceInfoLine.ParmId = VendInvoiceJour.ParmId 
    JOIN  VendInvoiceTrans
    ON VendInvoiceJour.InvoiceId = VendInvoiceTrans.InvoiceId
    AND VendInvoiceJour.numberSequenceGroup = VendInvoiceTrans.numberSequenceGroup 
    and VendInvoiceTrans.PURCHASELINELINENUMBER = PurchLine.LINENUMBER
    and VendInvoiceTrans.ITEMID = PurchLine.ITEMID
    --and VendInvoiceTrans.Qty > 0
    AND ((VendInvoiceTrans.INVOICEDATE>={ts '2024-02-01 00:00:00.000'}
    AND VendInvoiceTrans.INVOICEDATE<={ts '2024-02-29 00:00:00.000'})) 
    WHERE  PurchLine.DATAAREAID = 'SA01'
    GROUP BY PurchLine.PurchId, PurchLine.ItemId, PurchLine.InventTransId,VendInvoiceTrans.PURCHASELINELINENUMBER
     
  • Martin Dráb Profile Picture
    240,002 Most Valuable Professional on at
    Please tell us more about what you mean by "I have 2 qbds queries in report".
  • Layan Jwei Profile Picture
    8,271 Super User 2026 Season 1 on at
    Hi,

    I'm not sure I understood you correctly. Do you mean your query has two datasources and you are trying to get data from those datasources in the report?
    if this is the case, then you can do this in the RDP class:
    while (queryRun.next())
    {
        CustTrans custTrans   = queryRun.get(tablenum(CustTrans)) as CustTrans ;  //1st datasrouce table
        CustTable custTable   = queryRun.get(tableNum(CustTable)) as CustTable ;  //2nd datasource table
        //add your logic
    }

    if that's not the case, then please explain more.

    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Waed Ayyad Profile Picture
    9,212 Super User 2026 Season 1 on at
    Hi,
     
    What do you mean by 2 qbds? Do you have 2 DataSources on your query?
     
     
    Thanks,
    Waed Ayyad
  • Layan Jwei Profile Picture
    8,271 Super User 2026 Season 1 on at
    Hi,
     
    Is your question answered? If yes, then please verify the answers that helped.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 370

#3
Martin Dráb Profile Picture

Martin Dráb 283 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans