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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Writing a report for vendors with no activity - how to handle parent/child?

(0) ShareShare
ReportReport
Posted on by

I am writing my first SSRS report and it is for "vendors with no activity". My main query is below, but basically "no activity" is defined as no payments, purchases or POs since cutoffDate. 
One of the criteria for the report is "Do not include a parent account with no activity if the child account has activity" (parent is defined as the InvoiceAccount, so parent would have accountNum = InvoiceAccount, child would have a different AccountNum but the same InvoiceAccount)

My question is, should I try to:

1. Build that into my query below (how?)

2. After building the temp table (tmpVendorsWithNoActivity) cycle through it again using this query:

while select * from tmpVendorsWithNoActivity
        where tmpVendorsWithNoActivity.IsParent == "Yes"
        join vendTable where vendTable.InvoiceAccount == tmpVendorsWithNoActivity.InvoiceAccount
                          && vendTable.AccountNum     != tmpVendorsWithNoActivity.InvoiceAccount
        notexists join tmpVendorsWithNoActivity2
        where tmpVendorsWithNoActivity2.AccountNum != vendTable.AccountNum


Original Query to Build Temp Table

while select crossCompany AccountNum, InvoiceAccount, NBDCMMSAllowInvoices
    from vendTable
    where vendTable.Blocked != CustVendorBlocked::All
  notexists join * from vendTrans
    where vendTable.AccountNum == vendTrans.AccountNum
    && vendTrans.TransDate > cutoffDateTrans
  notExists join * from purchTable
    where vendTable.AccountNum == purchTable.OrderAccount
    && purchTable.createdDateTime > cutoffDate
  notExists join * from vendInvoiceJour
    where vendTable.AccountNum == vendInvoiceJour.InvoiceAccount
        && (vendInvoiceJour.InvoiceDate) > cutoffDateTrans


*This post is locked for comments

I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans